As designed [CodeEvent::fire ] Events startup order

According to a source of function "XenForo_CodeEvent::fire", 7 events that use hint (load_class, controller_pre_dispatch, template_hook, etc..) may have incorrect startup order: events of same event_id (regardless of the setting priority) with empty "Event Hint" are always starts before events with hint specified.

For example:
Event="TemplateHook" with hint="page_container_content_title_bar" and order=1 will be executed after Event="TemplateHook" with hint="" and order=1000.


XenForo developer
Staff member
This is documented on the listener page:
Lower execution orders will run first. Note that listeners that specify an event hint will always run after listeners that don't.