Skip to content

Commit

Permalink
[BUGFIX] Fix indexing of pages with fe_group -2 show at any login
Browse files Browse the repository at this point in the history
This change is the follow-up of TYPO3-Solr@a6168bcc6

Relates: TYPO3-Solr#3735, TYPO3-Solr#3811
  • Loading branch information
dkd-kaehm committed Oct 13, 2023
1 parent 9da29e1 commit 72f9ad2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Classes/EventListener/PageIndexer/FrontendGroupsModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ 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') < 1)
|| (
(int)$pageIndexerRequest->getParameter('userGroup') === 0
&& (
(int)$pageIndexerRequest->getParameter('pageUserGroup') !== -2
&&
(int)$pageIndexerRequest->getParameter('pageUserGroup') < 1
)
)
) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"fe_groups",
,"uid","pid","title"
,1,1,"group 1"
"pages",
,"uid","pid","is_siteroot","doktype","slug","title","subtitle","crdate","tstamp","fe_group"
,2,1,0,1,"/any_login","any login page","",1449151779,1449151770,-2
"tt_content",
,"uid","pid","CType","header","fe_group"
,11,"2","header","access restricted content for any login",0
"tx_solr_indexqueue_item",
,"uid","root","item_type","item_uid","indexing_configuration","changed","indexed","has_indexing_properties","indexing_priority","indexed","errors"
,4711,1,"pages",2,"pages",1449151778,0,0,0,0,0
11 changes: 11 additions & 0 deletions Tests/Integration/IndexQueue/PageIndexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@ public function canIndexPageWithAccessProtectedContentIntoSolrDataProvider(): Tr
],
];

yield 'page for any login(-2)' => [
'can_index_access_protected_page_show_at_any_login',
1,
[
'2:-2/c:0',
],
[
'access restricted content for any login',
],
];

yield 'protected page with protected content' => [
'can_index_access_protected_page_with_protected_contents',
2,
Expand Down

0 comments on commit 72f9ad2

Please sign in to comment.