Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-2295

ConfigScopeChangeSubscriber onConfigScopeChange method accepts wrong argument

    XMLWordPrintable

Details

    • Ibexa Open Source

    Description

      While removing Dynamic Settings for 3.0 via EZP-30543 ConfigScopeChangeSubscriber was changed to

      interface ConfigScopeChangeSubscriber
      {
          public function onConfigScopeChange(SiteAccess $siteAccess): void;
      }
      

      and got a possibility of auto-configuration as:

      $container->registerForAutoconfiguration(ConfigScopeChangeSubscriber::class)
                  ->addTag(
                      'kernel.event_listener',
                      ['method' => 'onConfigScopeChange', 'event' => MVCEvents::CONFIG_SCOPE_CHANGE]
                  )
                  ->addTag(
                      'kernel.event_listener',
                      ['method' => 'onConfigScopeChange', 'event' => MVCEvents::CONFIG_SCOPE_RESTORE]
                  );
      

      However it seems this never worked properly and was hidden because subscriber was never configured for any core service.
      For this to work, the interface needs to have the form:

      interface ConfigScopeChangeSubscriber
      {
          public function onConfigScopeChange(ScopeChangeEvent $event): void;
      }
      

      because this is what Symfony passes as an Event instance.

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              andrew.longosz@ibexa.co Andrew Longosz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: