In #1646580: Implement Config Events and Listeners, and storage realms for localized configuration we implemented a system of events and listeners for implementing overrides of config data (for instance for the purposes of internationalization.) A couple of open questions came out of that discussion
- How should we prioritize core implementations? These will run in a 'last executed wins' system when two listeners save to the same config data, so what should the priorities be?
- We also need to figure out priorities of the events within the systems. beejebus from that issue: "we have to consider both the priority of listeners within an event, and the order of different events across an object. so, as the patch stands, locale overrides override global conf overrides. perhaps we should collapse both of these subsystems to use the same event, something like 'config.override'?"
Comments
Comment #1
sunI actually think this issue goes far beyond the configuration system, and applies to all subscribed event listeners throughout Drupal... tagging appropriately.
Comment #2
Crell CreditAttribution: Crell commentedWhen registering a symfony event in the subscriber class you can specify a priority, which will determine the order in which they get called. (It's priority, not weight, because it orders backwards from Drupal's normal "negative first" ordering, I believe. So it goes.) So if you care, you can set your listener directly. (aka, this is per-hook weights, as we've always wanted.)
Comment #3
Eronarn CreditAttribution: Eronarn commentedI found something interesting in the Symfony docs: http://symfony.com/doc/2.1/cookbook/service_container/event_listener.html
We're already violating this guideline elsewhere (#1964482: Non-canonical Symfony priority in LanguageRequestSubscriber). We should avoid doing it here.
Comment #4
Crell CreditAttribution: Crell at Palantir.net commentedI don't know why this was tagged WSCCI...
Comment #5
dawehner@crell
Well, the point made by sun is that priorities made by core aren't that unimportant, so thinking about it in general might be a good idea.
Comment #6
Crell CreditAttribution: Crell at Palantir.net commentedSure, auditing our priorities to make sure they're logical is fine. But that has nothing to do with web services. :-)