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.
 
Back
Top Bottom