Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG [4026] treat non-overlayed mount points as valid #4029

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Classes/IndexQueue/Initializer/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ protected function initializeMountPointPages(): bool
// The page itself has its own content, which is handled like standard page.
$indexQueue = GeneralUtility::makeInstance(Queue::class);
$indexQueue->updateItem($this->type, $mountPoint['uid']);
$mountPointsInitialized = true;
}

// This can happen when the mount point does not show the content of the
Expand Down Expand Up @@ -160,7 +161,7 @@ protected function isMountPointValid(array $mountPoint): bool
{
$isValidMountPage = true;

if (empty($mountPoint['mountPageSource'])) {
if (!empty($mountPoint['mountPageOverlayed']) && empty($mountPoint['mountPageSource'])) {
$isValidMountPage = false;

$flashMessage = GeneralUtility::makeInstance(
Expand All @@ -173,7 +174,7 @@ protected function isMountPointValid(array $mountPoint): bool
$this->flashMessageQueue->addMessage($flashMessage);
}

if (!$this->mountedPageExists($mountPoint['mountPageSource'])) {
if (!empty($mountPoint['mountPageOverlayed']) && !$this->mountedPageExists($mountPoint['mountPageSource'])) {
$isValidMountPage = false;

$flashMessage = GeneralUtility::makeInstance(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"pages",
,"uid","pid","is_siteroot","doktype","mount_pid","mount_pid_ol","slug","title"
,10,1,0,7,2,0,"/mount-point","Mount Point"
,40,1,0,7,0,0,"/invalid-mount-point","Invalid Mount Point"
,40,1,0,7,0,1,"/invalid-mount-point","Invalid Mount Point"
,2,0,1,1,0,0,"/","Mounted"
,20,2,0,1,0,0,"/child-of-mounter","Child of Mounter"

4 changes: 2 additions & 2 deletions Tests/Integration/IndexQueue/Initializer/PageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function initializerIsFillingQueueWithMountPages(): void
$this->assertEmptyQueue();
$this->initializeAllPageIndexQueues();

$this->assertItemsInQueue(5);
$this->assertItemsInQueue(4);

// @todo: verify, is this really as expected? since mount_pid_ol is not set
// in the case when mount_pid_ol is set 4 pages get added
Expand Down Expand Up @@ -240,7 +240,7 @@ public function initializerAddsInfoMessagesAboutInvalidMountPages(): void
$this->assertEmptyQueue();
$this->initializeAllPageIndexQueues();

$this->assertItemsInQueue(5); // The root page of "testtwo.site aka integration_tree_two" is included.
$this->assertItemsInQueue(4); // The root page of "testtwo.site aka integration_tree_two" is included.

$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
$flashMessageQueue = $flashMessageService->getMessageQueueByIdentifier('solr.queue.initializer');
Expand Down