feat: explicitly add filter:admin/header.build hook

As it is not fired during middleware.processRender
This commit is contained in:
Julian Lam
2020-12-21 09:59:12 -05:00
parent 05d8b3c339
commit 75b1bbd09f

View File

@@ -79,6 +79,9 @@ middleware.renderHeader = async (req, res, data) => {
templateValues.template = { name: res.locals.template }; templateValues.template = { name: res.locals.template };
templateValues.template[res.locals.template] = true; templateValues.template[res.locals.template] = true;
// Normally this should hook be automatically added by middleware.processRender(), but it seems to only be fired for page hooks, and not when called internally.
({ templateValues } = await plugins.hooks.fire('filter:admin/header.build', { req, res, templateData: templateValues }));
return await req.app.renderAsync('admin/header', templateValues); return await req.app.renderAsync('admin/header', templateValues);
}; };