Skip to content

Commit 0c16992

Browse files
committed
simplify access to collections.all (and prevent breakage in custom engines missing ctx variables)
1 parent 0064599 commit 0c16992

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Filters/GetLocaleCollectionItem.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ function getLocaleCollectionItem(config, collection, pageOverride, langCode, ind
3636
}
3737

3838
// find the modified locale `page` again in `collections.all`
39-
let all =
40-
this.collections?.all ||
41-
this.ctx?.collections?.all ||
42-
this.context?.environments?.collections?.all ||
43-
[];
39+
let all = this.collections?.all || this.data?.collections?.all || [];
40+
4441
return getCollectionItem(all, modifiedLocalePage, 0);
4542
}
4643

0 commit comments

Comments
 (0)