From 3430c4772550cc3554900a141176373b20019eb3 Mon Sep 17 00:00:00 2001 From: Fabien 'egg' O'Carroll Date: Mon, 17 Aug 2020 15:21:09 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20meta=20data=20when=20usi?= =?UTF-8?q?ng=20tag=20data=20in=20collection=20(#12137)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #12130 When defining a collection with a tag as the data source, the metadata was not correctly applied due to the context array not including 'tag'. This update keeps the context management all in the same context helper file and follows the same pattern as for posts/pages as a data source. --- core/frontend/services/routing/helpers/context.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/frontend/services/routing/helpers/context.js b/core/frontend/services/routing/helpers/context.js index 8894866615..3a362007d5 100644 --- a/core/frontend/services/routing/helpers/context.js +++ b/core/frontend/services/routing/helpers/context.js @@ -71,6 +71,10 @@ function setResponseContext(req, res, data) { if (!res.locals.context.includes('page')) { res.locals.context.push('page'); } + } else if (data && data.tag) { + if (!res.locals.context.includes('tag')) { + res.locals.context.push('tag'); + } } }