Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-14232

Extension settings don't override as expected when the extension is per-siteaccess activated

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Medium Medium
    • None
    • 4.0.1
    • Legacy > Extensions, Misc
    • None
    • PHP Version: php 5.2.6
      eZ publish 4.0.1

    Description

      Using some settings in an extension that is only defined to be activated for one siteaccess can result in strange override behaviors.
      Indeed, initializing siteaccess defined values (an empty array) that is overridden (completed) by an extension just seems to be impossible if the extension has to be defined for one siteaccess only (by using ActiveAccessExtensions[] instead of ActiveExtensions[]).

      It then becomes difficult to have some sort of "plug and play" extension (which adds its own settings) as it may result to some unexpected behaviors in some context. For an example, using smoothgallery ( http://ez.no/developer/contribs/applications/ez_smoothgallery ) may not be easy because of this override unconsistence.
      Details to reproduce are given in the dedicated part.

      Steps to reproduce
      • With a fresh eZ publish distribution, create a testing extension that can be called "test"
        The extension will contain a folder "settings", in which you will place, for an example, an override on file image.ini ( image.ini.append.php )
      • In the created image.ini.append.php file, override the alias settings:
        [AliasSettings]
        AliasList[]=extensionalias
        AliasList[]=extensionanotheralias
      • Create an overriding image.ini file for your user siteaccess (by creating settings/siteaccess/[usersite]/image.ini.append.php) , in which you'll define a bunch of aliases:
        [AliasSettings]
        AliasList[]=sitealias
        AliasList[]=siteanotheralias
      • Now you can activate your extension for all sites, by adding
        [ExtensionSettings]
        ActiveExtensions[]=test

        in file settings/override/site.ini.append.php.
        Until now all should work as expected, the order default -> siteaccess -> extension -> override is respected.
        The result is also visible in the ini administration panel, properly filtered on your user site.

      • Now try to initialize the alias array, by adding
        AliasList[]

        in your siteaccess settings, the result is like this:

        [AliasSettings]
        AliasList[]
        AliasList[]=sitealias
        AliasList[]=siteanotheralias

        Try to see the overrides, you will see that it works fine, but you can already notice that the location given is false (default is given, although it should be siteaccess and extension).

      • You can now deactivate the extension and reactivate it, but only for one siteaccess. It can then be done by adding
        [ExtensionSettings]
        ActiveAccessExtensions[]=test

        in your siteaccess site.ini (settings/[usersite]/site.ini.append.php
        We're expecting for the same behavior but it won't be: only siteaccess variables were kept, extension settings have disappared.
        By removing the array initialization of your siteaccess override (AliasList[]), you can notice that the order has in fact been inversed, extension settings come first and are then overridden by siteaccess ones.
        Then in that kind of cases, the override doesn't work as expected and it won't be possible to have settings from an extension available.

      Attachments

        Activity

          People

            unknown unknown
            alexandre.nion alexandre.nion
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: