This repository has been archived by the owner on Jan 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Running tests of zend-navigation against all v2 components (no v3 components) revealed a circular dependency condition in the navigation helpers related to `getEventManager()`. In v2, `getEventManager()` has lazy-loaded an EM instance, and an initializer was checking the returned instance to see if its `SharedEventManager` instance was present and/or the same as the one in the container; if not, it was re-injecting the EM instance from the container. Unfortunately, this fails now, as the call to `setEventManager()` now attaches the default listeners, and requires that a shared manager is present. This patch changes the behavior to the following: - `getEventManager()` now *never* lazy-loads an instance. This ensures that the initializer doesn't lead to lazy-population of the shared manager. - `setEventManager()` was updated to check that we have a shared manager before attempting to call `setDefaultListeners()`. - Internally, if an EM instance is needed, it now lazy-creates one, *with a shared manager*, and calls `setEventManager()` with the new EM instance. - The EM initializer in the helper plugin amanger was updated to first check that we have an `EventManager` instance before attempting to inject one.
- Loading branch information
1 parent
2ef915e
commit fed4b7a
Showing
4 changed files
with
33 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters