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

Can register custom OutputVisitor but can't set its priority so it fails due to match-all regexp in kernel

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Medium Medium
    • Resolution: Fixed
    • Affects Version/s: 1.3.1, 1.4.1
    • Fix Version/s: 1.5.0
    • Component/s: Platform > REST API v2
    • Labels:
      None

      Description

      You can define custom output visitors and tag it (name: ezpublish_rest.output.visitor, regexps: something) but it won't work with current implementation unless you load your bundle before new eZ\Bundle\EzPublishRestBundle\EzPublishRestBundle(), (and this way sucks). It's because of order of output visitors passed to compiler pass while kernel configuration contains Pokemon "gotta catch'em all" regexp (^./.$) so it always return application/vnd.ez.api... regardless of visitors and generators registered after that one.

        Issue Links

          Activity

          Show
          Sławomir Uchto added a comment - PR : https://github.com/ezsystems/ezpublish-kernel/pull/1736
          Show
          André Rømcke added a comment - Merged in https://github.com/ezsystems/ezpublish-kernel/commit/af52bc8181b074575d8ead853bf8e381d43e6869
          Hide
          Bertrand Dunogier added a comment - - edited

          Unless I'm misunderstanding Miguel's comment, this is what is intended: services with higher priority (ex: 20 > 10) are meant to be executed first.

          Same than Symfony: The other optional tag attribute is called priority, which defaults to 0 and it controls the order in which listeners are executed (the highest the priority, the earlier a listener is executed) (http://symfony.com/doc/current/event_dispatcher.html).

          Show
          Bertrand Dunogier added a comment - - edited Unless I'm misunderstanding Miguel's comment, this is what is intended: services with higher priority (ex: 20 > 10) are meant to be executed first. Same than Symfony: The other optional tag attribute is called priority, which defaults to 0 and it controls the order in which listeners are executed (the highest the priority, the earlier a listener is executed) ( http://symfony.com/doc/current/event_dispatcher.html ).
          Hide
          Bertrand Dunogier added a comment -

          QA, can you please provide feedback based on the above comments ? This is being shipped with 1.5.0, so let's hope we're good

          Show
          Bertrand Dunogier added a comment - QA, can you please provide feedback based on the above comments ? This is being shipped with 1.5.0, so let's hope we're good
          Hide
          Miguel das Neves Jacinto (Inactive) added a comment -

          After discussing this with Sławomir Uchto we found out that there was a bug. When the same regex is used the priority is not taken into account, the last generator register is the one used, while it should be the one with higher priority.

          Show
          Miguel das Neves Jacinto (Inactive) added a comment - After discussing this with Sławomir Uchto we found out that there was a bug. When the same regex is used the priority is not taken into account, the last generator register is the one used, while it should be the one with higher priority.
          Hide
          Bertrand Dunogier added a comment -

          This is indeed a bug.

          But does it make much sense to use the same regex multiple times ?
          In any case, Sławomir Uchto, can you provide a fix for this ?

          Show
          Bertrand Dunogier added a comment - This is indeed a bug. But does it make much sense to use the same regex multiple times ? In any case, Sławomir Uchto , can you provide a fix for this ?
          Hide
          Bertrand Dunogier added a comment - - edited

          Created EZP-26242 for the issue found by QA.

          Show
          Bertrand Dunogier added a comment - - edited Created EZP-26242 for the issue found by QA.
          Hide
          Sarah Haïm-Lubczanski (Inactive) added a comment -
          Show
          Sarah Haïm-Lubczanski (Inactive) added a comment - Follow-up created https://jira.ez.no/browse/EZP-26242

            People

            • Assignee:
              Unassigned
              Reporter:
              Sławomir Uchto
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: