- Affected version
- 2.3.13
Opening an add-on’s controls menu calls XF\Admin\Controller\AddOnController::actionControls(), which executes:
All matching templates including template and template_parsed are loaded only to determine whether public/ email /admin templates exist
On large installations query can take dozens of seconds
Suggested fix: Retrieve only the available types:
Also adding an index on (addon_id, type)
the standard table schema has no index with addon_id[/CODE]
Code:
$templates = $this->finder(TemplateFinder::class)
->where('addon_id', $addOn->addon_id)
->fetch()
->groupBy('type');
SQL:
SELECT *
FROM xf_template
WHERE addon_id = 'OzzModz/KnowledgeBase';
On large installations query can take dozens of seconds
Suggested fix: Retrieve only the available types:
SQL:
SELECT DISTINCT type
FROM xf_template
WHERE addon_id = ?
Also adding an index on (addon_id, type)
the standard table schema has no index with addon_id[/CODE]