Skip to content

Commit

Permalink
[BUGFIX] treat non-overlayed mount points as valid
Browse files Browse the repository at this point in the history
Allows non-overlayed mount points to be valid.

Fixes: #4026
  • Loading branch information
derMatze82 authored Jun 6, 2024
1 parent fe42a48 commit 2e4e166
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
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

0 comments on commit 2e4e166

Please sign in to comment.