forked from TYPO3-Solr/ext-solr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Fix monitoring of mounted pages
EXT:solr fails to detect changes on mounted pages correctly in some special occasions: * mounted pages not considered during garbage removal / ce updates * no_search_sub_entries flag not respected by GarbageRemover strategies * existing queue items of mounted pages not updated By adjusting the monitoring related components the issues are fixed, affected components: * GarbageRemover strategies * page initializer * RecordMonitor * DataUpdateHandler Fixes: TYPO3-Solr#4275
- Loading branch information
1 parent
fe71a4f
commit b43c563
Showing
11 changed files
with
470 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace ApacheSolrForTypo3\Solr\Traits; | ||
|
||
use TYPO3\CMS\Core\Exception\Page\PageNotFoundException; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Core\Utility\RootlineUtility; | ||
|
||
trait SkipRecordByRootlineConfigurationTrait | ||
{ | ||
/** | ||
* Check if at least one page in the record's rootline is configured to exclude sub-entries from indexing | ||
*/ | ||
protected function skipRecordByRootlineConfiguration(int $pid): bool | ||
{ | ||
/** @var RootlineUtility $rootlineUtility */ | ||
$rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pid); | ||
try { | ||
$rootline = $rootlineUtility->get(); | ||
} catch (PageNotFoundException) { | ||
return true; | ||
} | ||
foreach ($rootline as $page) { | ||
if (isset($page['no_search_sub_entries']) && $page['no_search_sub_entries']) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
Tests/Integration/IndexQueue/Fixtures/mount_page_updates.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"pages", | ||
,"uid","pid","tstamp","hidden","doktype","mount_pid","mount_pid_ol","slug","title","no_search_sub_entries" | ||
,2,1,1736145036,0,254,0,0,"/sysfolder","Sys folder (no_search_sub_entries)",1 | ||
,20,2,1736145036,0,1,0,0,"/mounted-page-in-sysfolder","Mounted page in sysfolder",0 | ||
,21,1,1736145036,0,1,0,0,"/mounted-page-on-root","Mounted page on root page",0 | ||
,22,2,1736145036,0,1,0,0,"/another-mounted-page-in-sysfolder","Another mounted page in sysfolder",0 | ||
,30,1,1736145036,0,7,20,1,"/mount-point-1","Mount point for page in sysfolder",0 | ||
,31,1,1736145036,0,7,21,1,"/mount-point-2","Mount point for page on root page",0 | ||
,32,1,1736145036,0,7,22,1,"/mount-point-3","Mount point for another page in sysfolder",0 | ||
"tt_content", | ||
,"uid","pid","header","hidden" | ||
,20,20,"ce on mounted page",0 | ||
,21,20,"hidden ce on mounted page",1 | ||
,22,21,"ce on mounted page",0 | ||
,23,21,"hidden ce on mounted page",1 | ||
,24,22,"ce on another mounted page",0 | ||
,25,22,"hidden ce on another mounted page",1 | ||
"tx_solr_indexqueue_item" | ||
,"uid","root","item_type","item_uid","indexing_configuration","has_indexing_properties","pages_mountidentifier","errors" | ||
,1,1,"pages",22,"pages",1,"22-32-1","" | ||
"tx_solr_indexqueue_indexing_property" | ||
,"uid","root","item_id","property_key","property_value" | ||
,1,1,1,"mountPageSource",22 | ||
,2,1,1,"mountPageDestination",32 | ||
,3,1,1,"isMountedPage",1 |
Oops, something went wrong.