Skip to content

Commit

Permalink
search page is another silly candidate for export as a related document
Browse files Browse the repository at this point in the history
  • Loading branch information
boutell committed Jan 6, 2025
1 parent 8a44231 commit 6c4624c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/methods/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,10 @@ module.exports = self => {
([ name, module ]) => self.apos.instanceOf(module, '@apostrophecms/page-type'))
.map(([ name, module ]) => name);
for (const type of pageTypes) {
if (type === '@apostrophecms/archive-page') {
// It is never appropriate to export the root page of the trash
if ([ '@apostrophecms/archive-page', '@apostrophecms/search' ].includes(type)) {
// It is never appropriate to export the root page of the trash, and
// while you *could* link to the search page it is extremely unlikely it
// would have interesting content to export, just confusing to have it here
continue;
}
self.pushRelatedType(req, related, type, recursions);
Expand Down
2 changes: 0 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,6 @@ describe('@apostrophecms/import-export', function () {
relatedTypesArticles: [
'topic',
'@apostrophecms/home-page',
'@apostrophecms/search',
'home-page',
'default-page',
'@apostrophecms/image',
Expand All @@ -950,7 +949,6 @@ describe('@apostrophecms/import-export', function () {
],
relatedTypesTopics: [
'@apostrophecms/home-page',
'@apostrophecms/search',
'home-page',
'default-page',
'@apostrophecms/image',
Expand Down

0 comments on commit 6c4624c

Please sign in to comment.