Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-19824

Event listeners are missing if container cache is disabled

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7
    • Fix Version/s: 4.7.16
    • Component/s: Core CiviCRM
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Core Team Funds
    • Verified?:
      No

      Description

      v4.7.0 introduced compilation, caching, and tagged-services for "Civi\Core\Container".

      Steps to reproduce:

      1. Observe: In Civi/Core/Container.php, "civi_token_compat" is tagged with "kernel.event_subscriber".
      2. Set "define('CIVICRM_CONTAINER_CACHE', 'never');"
      3. Find any piece of code that relies on the service "dispatcher". Set a breakpoint.
      4. Execute the code. Inspect the list of event listeners.
      5. The dispatcher should include "civi_token_compat" (Civi\Token\TokenCompatSubscriber)... but it's missing.

      The tag "kernel.event_subscriber" is scanned during compilation. However, if you disable caching, then it skips compilation, and any listeners like "civi_token_compat" (and others) are not properly detected.

      This affects some testing scenarios which rely on CIVICRM_CONTAINER_CACHE==never.

      This is an offshoot of CRM-19690.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                monish.deb Monish Deb
                Reporter:
                timotten Tim Otten
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: