diff --git a/Classes/EventListener/PageIndexer/FrontendGroupsModifier.php b/Classes/EventListener/PageIndexer/FrontendGroupsModifier.php index 196063eac8..da9391d3ec 100644 --- a/Classes/EventListener/PageIndexer/FrontendGroupsModifier.php +++ b/Classes/EventListener/PageIndexer/FrontendGroupsModifier.php @@ -40,15 +40,20 @@ class FrontendGroupsModifier public function __invoke(ModifyResolvedFrontendGroupsEvent $event): void { $pageIndexerRequest = $event->getRequest()->getAttribute('solr.pageIndexingInstructions'); - if (!$pageIndexerRequest instanceof PageIndexerRequest - || ( - (int)$pageIndexerRequest->getParameter('userGroup') === 0 - && ( - (int)$pageIndexerRequest->getParameter('pageUserGroup') !== -2 - && - (int)$pageIndexerRequest->getParameter('pageUserGroup') < 1 - ) + if (!$pageIndexerRequest instanceof PageIndexerRequest) { + return; + } + + $groups = $this->resolveFrontendUserGroups($pageIndexerRequest); + + $noRelevantFrontendUserGroupResolved = empty($groups) || (count($groups) === 1 && $groups[0] === 0); + if ((int)$pageIndexerRequest->getParameter('userGroup') === 0 + && ( + (int)$pageIndexerRequest->getParameter('pageUserGroup') !== -2 + && + (int)$pageIndexerRequest->getParameter('pageUserGroup') < 1 ) + && $noRelevantFrontendUserGroupResolved ) { return; } @@ -76,7 +81,6 @@ public function __invoke(ModifyResolvedFrontendGroupsEvent $event): void ); } - $groups = $this->resolveFrontendUserGroups($pageIndexerRequest); if ((int)$pageIndexerRequest->getParameter('pageUserGroup') > 0) { $groups[] = (int)$pageIndexerRequest->getParameter('pageUserGroup'); } diff --git a/Tests/Integration/IndexQueue/Fixtures/can_index_sub_page_of_protected_page_with_extend_to_subpage.csv b/Tests/Integration/IndexQueue/Fixtures/can_index_sub_page_of_protected_page_with_extend_to_subpage.csv new file mode 100644 index 0000000000..58781e6318 --- /dev/null +++ b/Tests/Integration/IndexQueue/Fixtures/can_index_sub_page_of_protected_page_with_extend_to_subpage.csv @@ -0,0 +1,13 @@ +"fe_groups", +,"uid","pid","title" +,1,1,"group 1" +"pages", +,"uid","pid","is_siteroot","doktype","slug","title","subtitle","crdate","tstamp","fe_group",extendToSubpages +,2,1,0,1,"/protected_page","protected page","",1449151778,1449151778,1,1 +,3,2,0,1,/sub_page,sub page, ,1449151779,1449151779,0,0 +"tt_content", +,"uid","pid","CType","header","fe_group","sorting" +,10,3,"header",public content of protected page,0,10 +"tx_solr_indexqueue_item", +,"uid","root","item_type","item_uid","indexing_configuration","changed","indexed","has_indexing_properties","indexing_priority","indexed","errors" +,4711,1,"pages",3,"pages",1449151778,0,0,0,0,0 diff --git a/Tests/Integration/IndexQueue/PageIndexerTest.php b/Tests/Integration/IndexQueue/PageIndexerTest.php index 7ca8573e05..741444ec6b 100644 --- a/Tests/Integration/IndexQueue/PageIndexerTest.php +++ b/Tests/Integration/IndexQueue/PageIndexerTest.php @@ -202,6 +202,17 @@ public function canIndexPageWithAccessProtectedContentIntoSolrDataProvider(): Tr 'protected ce', ], ]; + + yield 'page protected by extend to subpages' => [ + 'can_index_sub_page_of_protected_page_with_extend_to_subpage', + 1, + [ + '2:1/c:0', + ], + [ + 'public content of protected page', + ], + ]; } /**