From 75b1bbd09fe54115a8bef500c3de9156ad9b2d7e Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 21 Dec 2020 09:59:12 -0500 Subject: [PATCH] feat: explicitly add filter:admin/header.build hook As it is not fired during middleware.processRender --- src/middleware/admin.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/middleware/admin.js b/src/middleware/admin.js index 021ccd2785..41ad3dbc33 100644 --- a/src/middleware/admin.js +++ b/src/middleware/admin.js @@ -79,6 +79,9 @@ middleware.renderHeader = async (req, res, data) => { templateValues.template = { name: res.locals.template }; 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); };