Fixed criteria_template_data event lacks context

DragonByte Tech

Well-known member
Affected version
2.3.7
When listening to the criteria_template_data event, there is no way to obtain any information about the context. This means that any database queries for data that is only relevant to a certain criteria type, such as UserCriteria, will get duplicated for PageCriteria and any custom criteria handlers we add.

The extension should pass $this into the args, f.ex. $this->app->fire('criteria_template_data', [&$templateData, $this]); so we can limit database queries via instanceof.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.8).

Change log:
Pass criteria object to `criteria_template_data` event listeners
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom