Skip to content

Commit e68e267

Browse files
committed
Resolve conflicts
2 parents 95ee241 + cca5019 commit e68e267

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
### Fixes
1414

1515
* Ensure relationship convert handler can handle properly some cases where the document and request modes are different.
16+
* Exclude unknown page types from the page manager.
1617

1718
## 4.19.0 (2025-07-09)
1819

modules/@apostrophecms/page/ui/apos/logic/AposPagesManager.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ export default {
397397
pageTree = pageTree._children;
398398
}
399399

400+
pageTree = filterValidPages(pageTree);
400401
formatPage(pageTree);
401402

402403
if (!pageTree.length && pageTree.length !== 0) {
@@ -415,13 +416,35 @@ export default {
415416
page.forEach(formatPage);
416417
return;
417418
}
419+
if (!page._id) {
420+
return;
421+
}
418422

419423
self.pagesFlat.push(klona(page));
420424

421425
if (Array.isArray(page._children)) {
422426
page._children.forEach(formatPage);
423427
}
424428
}
429+
430+
function filterValidPages(page) {
431+
const result = {};
432+
if (!self.moduleOptions.validPageTypes.includes(page.type)) {
433+
return result;
434+
}
435+
436+
Object.assign(result, page);
437+
438+
result._children = [];
439+
for (const child of page._children || []) {
440+
const filteredChild = filterValidPages(child);
441+
if (filteredChild._id) {
442+
result._children.push(filteredChild);
443+
}
444+
}
445+
446+
return result;
447+
}
425448
},
426449
getAllPagesTotal () {
427450
this.setAllPiecesSelection({

0 commit comments

Comments
 (0)