From 0c1699207cd02165d79636388207599d48899238 Mon Sep 17 00:00:00 2001 From: Noel Forte Date: Mon, 28 Apr 2025 19:27:07 -0400 Subject: [PATCH] simplify access to collections.all (and prevent breakage in custom engines missing `ctx` variables) --- src/Filters/GetLocaleCollectionItem.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Filters/GetLocaleCollectionItem.js b/src/Filters/GetLocaleCollectionItem.js index 1f966228e..0a66041ea 100644 --- a/src/Filters/GetLocaleCollectionItem.js +++ b/src/Filters/GetLocaleCollectionItem.js @@ -36,11 +36,8 @@ function getLocaleCollectionItem(config, collection, pageOverride, langCode, ind } // find the modified locale `page` again in `collections.all` - let all = - this.collections?.all || - this.ctx?.collections?.all || - this.context?.environments?.collections?.all || - []; + let all = this.collections?.all || this.data?.collections?.all || []; + return getCollectionItem(all, modifiedLocalePage, 0); }