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

[BUGFIX:BP:11.5] TSFE can not be initialized for pages with fe_group="-2" #3819

Open
wants to merge 1 commit into
base: release-11.5.x
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<dataset>
<pages>
<uid>2</uid>
<is_siteroot>0</is_siteroot>
<doktype>1</doktype>
<pid>1</pid>
<fe_group>1</fe_group>
</pages>
<pages>
<uid>3</uid>
<is_siteroot>0</is_siteroot>
<doktype>1</doktype>
<pid>1</pid>
<fe_group>-2</fe_group>
</pages>

<fe_groups>
<uid>1</uid>
<pid>1</pid>
<title>dummy group</title>
</fe_groups>
</dataset>
34 changes: 34 additions & 0 deletions Tests/Integration/FrontendEnvironment/TsfeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use ApacheSolrForTypo3\Solr\Tests\Integration\IntegrationTest;
use RuntimeException;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;

class TsfeTest extends IntegrationTest
{
Expand Down Expand Up @@ -53,4 +54,37 @@ public function initializeTsfeWithNoDefaultPageAndPageErrorHandlerDoNotThrowAnEr
$tsfeManager = GeneralUtility::makeInstance(Tsfe::class);
$tsfeManager->getTsfeByPageIdAndLanguageId(1);
}

/**
* @test
*/
public function canInitializeTsfeForPageWithDifferentFeGroupsSettings()
{
$this->writeDefaultSolrTestSiteConfiguration();
$this->importDataSetFromFixture('can_initialize_tsfe_for_page_with_different_fe_groups_settings.xml');

$tsfeNotRestricted = GeneralUtility::makeInstance(Tsfe::class)->getTsfeByPageIdIgnoringLanguage(1);
self::assertInstanceOf(
TypoScriptFrontendController::class,
$tsfeNotRestricted,
'The TSFE can not be initialized at all, nor for public page either for access restricted(fe_group) page. ' .
'Most probably nothing will work.'
);

$tsfeRestrictedForExistingFeGroup = GeneralUtility::makeInstance(Tsfe::class)->getTsfeByPageIdIgnoringLanguage(2);
self::assertInstanceOf(
TypoScriptFrontendController::class,
$tsfeRestrictedForExistingFeGroup,
'The TSFE can not be initialized for existing fe_group. ' .
'This will lead to failures on editing the access restricted [sub]pages in BE.'
);

$tsfeForLoggedInUserOnly = GeneralUtility::makeInstance(Tsfe::class)->getTsfeByPageIdIgnoringLanguage(3);
self::assertInstanceOf(
TypoScriptFrontendController::class,
$tsfeForLoggedInUserOnly,
'The TSFE can not be initialized for page with fe_group="-2". ' .
'This will lead to failures on editing the [sub]pages in BE for pages with fe_group="-2".'
);
}
}
Loading