...
 
Commits (4)
......@@ -44,7 +44,7 @@ return [
'7-hideinmenu' => 'apps-pagetree-page-mountpoint-hideinmenu',
'7-root' => 'apps-pagetree-page-mountpoint-root',
'199' => 'apps-pagetree-spacer',
'199-hideinmenu' => 'apps-pagetree-spacer',
'199-hideinmenu' => 'apps-pagetree-spacer-hideinmenu',
'199-root' => 'apps-pagetree-page-domain',
'254' => 'apps-pagetree-folder-default',
'254-hideinmenu' => 'apps-pagetree-folder-default',
......
......@@ -170,6 +170,16 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
$this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdSecond];
}
/**
* See DataSet/localizeContentWHideAtCopy.csv
*/
public function localizeContentWithHideAtCopy()
{
$GLOBALS['TCA'][self::TABLE_Content]['ctrl']['hideAtCopy'] = true;
self::localizeContent();
$this->actionService->modifyRecord(self::TABLE_Content, $this->recordIds['localizedContentId'], ['hidden' => 0]);
}
/**
* @see DataSet/localizeContentRecord.csv
* @see \TYPO3\CMS\Core\Migrations\TcaMigration::sanitizeControlSectionIntegrity()
......
......@@ -2319,6 +2319,15 @@ class TypoScriptFrontendController implements LoggerAwareInterface
if ($this->cHash || $skip) {
return;
}
if ($this->pageArguments) {
$queryParams = $this->pageArguments->getDynamicArguments();
$queryParams['id'] = $this->pageArguments->getPageId();
$argumentsThatWouldRequireCacheHash = $this->cacheHash
->getRelevantParameters(HttpUtility::buildQueryString($queryParams));
if (empty($argumentsThatWouldRequireCacheHash)) {
return;
}
}
if ($GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFoundOnCHashError']) {
$response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
$GLOBALS['TYPO3_REQUEST'],
......
......@@ -18,11 +18,15 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\Controller;
use TYPO3\CMS\Core\Cache\Backend\NullBackend;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Error\Http\PageNotFoundException;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\CMS\Core\Http\ServerRequestFactory;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\PageTitle\PageTitleProviderManager;
use TYPO3\CMS\Core\Routing\PageArguments;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
use TYPO3\CMS\Frontend\Page\CacheHashCalculator;
use TYPO3\CMS\Frontend\Page\PageRepository;
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
......@@ -496,4 +500,82 @@ class TypoScriptFrontendControllerTest extends UnitTestCase
$subject->generatePageTitle();
$this->assertSame($pageTitle, $subject->indexedDocTitle);
}
public function requireCacheHashValidateRelevantParametersDataProvider(): array
{
return [
'no extra params' => [
[],
false,
],
'with required param' => [
[
'abc' => 1,
],
true,
],
'with required params' => [
[
'abc' => 1,
'abcd' => 1,
],
true,
],
'with not required param' => [
[
'fbclid' => 1,
],
false,
],
'with not required params' => [
[
'fbclid' => 1,
'gclid' => 1,
'foo' => [
'bar' => 1,
],
],
false,
],
'with combined params' => [
[
'abc' => 1,
'fbclid' => 1,
],
true,
],
'with multiple combined params' => [
[
'abc' => 1,
'fbclid' => 1,
'abcd' => 1,
'gclid' => 1
],
true,
]
];
}
/**
* @test
*
* @dataProvider requireCacheHashValidateRelevantParametersDataProvider
* @param array $remainingArguments
* @param bool $expected
*/
public function requireCacheHashValidateRelevantParameters(array $remainingArguments, bool $expected): void
{
$GLOBALS['TYPO3_REQUEST'] = new ServerRequest();
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFoundOnCHashError'] = true;
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'] = ['gclid', 'fbclid', 'foo[bar]'];
$this->subject = $this->getAccessibleMock(TypoScriptFrontendController::class, ['dummy'], [], '', false);
$this->subject->_set('cacheHash', new CacheHashCalculator());
$this->subject->_set('pageArguments', new PageArguments(1, '0', ['tx_test' => 1], ['tx_test' => 1], $remainingArguments));
if ($expected) {
static::expectException(PageNotFoundException::class);
}
$this->subject->reqCHash();
}
}
.. include:: ../Includes.txt
.. highlight:: typoscript
.. _config-typo3:
......@@ -23,22 +23,23 @@ Page TSconfig
Relevant Settings for `rte_ckeditor`
------------------------------------
Page TSconfig can be used to change
Page TSconfig can be used to change:
#. Default preset::
RTE.default.preset = full
#. Override for one table (:ts:`RTE.config.table.column.preset`)::
* the preset used in general
* or the preset used by specific database table fields.
* or the preset used by specific database table fields for a specific table type (see :ref:`t3tca:types`).
RTE.config.tx_news_domain_model_news.preset = minimal
.. code-block:: typoscript
#. Override for one field (:ts:`RTE.config.table.column.name.preset`)::
# Default preset
RTE.default.preset = full
RTE.config.tt_content.bodytext.preset = normal
# RTE.config.table.column.preset = presetIdentifier
RTE.config.tx_news_domain_model_news.preset = minimal
#. Override for one field, if type matches (:ts:`RTE.config.table.column.types.name.preset`)::
# RTE.config.table.column.types.name.preset = presetIdentifier
RTE.config.tt_content.types.textpic.preset = default
RTE.config.tt_content.bodytext.types.textmedia.preset = minimal
For more examples, see :ref:`t3tsconfig:pageTsRte` in "TSconfig Reference".
......
......@@ -10,17 +10,17 @@
,1,0,0,"Dansk","dk",,,,,,,,,,,,,,,
,2,0,0,"Deutsch","de",,,,,,,,,,,,,,,
"sys_category",,,,,,,,,,,,,,,,,,,,
,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","parent","items","l10n_diffsource","description",,,
,28,0,256,0,0,0,0,0,0,0,0,0,"Category A",0,0,,,,,
,29,0,512,0,0,0,0,0,0,0,0,0,"Category B",0,0,,,,,
,30,0,768,0,0,0,0,0,0,0,0,0,"Category C",0,0,,,,,
,31,0,1024,0,0,0,0,0,0,0,0,0,"Category A.A",28,0,,,,,
,"uid","pid","sorting","hidden","deleted","sys_language_uid","l10n_parent","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","parent","items","l10n_diffsource","description",,
,28,0,256,0,0,0,0,0,0,0,0,0,0,"Category A",0,0,,,,
,29,0,512,0,0,0,0,0,0,0,0,0,0,"Category B",0,0,,,,
,30,0,768,0,0,0,0,0,0,0,0,0,0,"Category C",0,0,,,,
,31,0,1024,0,0,0,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
"tt_content",,,,,,,,,,,,,,,,,,,,
,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","l10n_source","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","bodytext",,,,,
,296,88,256,0,0,0,0,0,0,0,0,0,0,"Regular Element #0",,,,,,
,297,89,256,0,0,0,0,0,0,0,0,0,0,"Regular Element #1",,,,,,
,298,89,512,0,0,0,0,0,0,0,0,0,0,"Regular Element #2",,,,,,
,299,89,768,0,0,0,0,0,0,0,0,0,0,"Regular Element #3",,,,,,
,300,89,1024,0,1,299,299,299,0,0,0,0,0,"[Translate to Dansk:] Regular Element #3",,,,,,
,301,89,384,0,1,297,297,297,0,0,0,0,0,"[Translate to Dansk:] Regular Element #1",,,,,,
,302,89,448,0,2,297,301,301,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1",,,,,,
,"uid","pid","sorting","hidden","deleted","sys_language_uid","l18n_parent","l10n_source","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","bodytext",,,,
,296,88,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #0",,,,,
,297,89,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #1",,,,,
,298,89,512,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #2",,,,,
,299,89,768,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #3",,,,,
,300,89,1024,0,0,1,299,299,299,0,0,0,0,0,"[Translate to Dansk:] Regular Element #3",,,,,
,301,89,384,0,0,1,297,297,297,0,0,0,0,0,"[Translate to Dansk:] Regular Element #1",,,,,
,302,89,448,0,0,2,297,301,301,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1",,,,,
"pages",,,,,,,,,,,,
,"uid","pid","sorting","deleted","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","slug"
,1,0,256,0,0,0,0,0,0,0,"FunctionalTest","/"
,88,1,256,0,0,0,0,0,0,0,"DataHandlerTest","/data-handler"
,89,88,256,0,0,0,0,0,0,0,"Relations","/data-handler/relations"
,90,88,512,0,0,0,0,0,0,0,"Target","/data-handler/target"
"pages",,,,,,,,,,,,,
,"uid","pid","sorting","hidden","deleted","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","slug"
,1,0,256,0,0,0,0,0,0,0,0,"FunctionalTest","/"
,88,1,256,0,0,0,0,0,0,0,0,"DataHandlerTest","/data-handler"
,89,88,256,0,0,0,0,0,0,0,0,"Relations","/data-handler/relations"
,90,88,512,0,0,0,0,0,0,0,0,"Target","/data-handler/target"
......@@ -180,6 +180,23 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', '[Translate to Dansk:] Regular Element #2'));
}
/**
* @test
* See DataSet/localizeContentRecord.csv
*/
public function localizeContentWithHideAtCopy()
{
// Create translated page first
$this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
parent::localizeContentWithHideAtCopy();
$this->assertAssertionDataSet('localizeContentWHideAtCopy');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
// @todo Localized element should be retrieved
self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1' /* , '[Translate to Dansk:] Regular Element #2'*/));
}
/**
* @test
* @see DataSet/localizeContentFromNonDefaultLanguage.csv
......
"tt_content",,,,,,,,,,,,,,
,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","l10n_source","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header"
,296,88,256,0,0,0,0,0,0,0,0,0,0,"Regular Element #0"
,297,89,256,0,0,0,0,0,0,0,0,0,0,"Regular Element #1"
,298,89,512,0,0,0,0,0,0,0,0,0,0,"Regular Element #2"
,299,89,768,0,0,0,0,0,0,0,0,0,0,"Regular Element #3"
,300,89,1024,0,1,299,299,299,0,0,0,0,0,"[Translate to Dansk:] Regular Element #3"
,301,89,384,0,1,297,297,297,0,0,0,0,0,"[Translate to Dansk:] Regular Element #1"
,302,89,448,0,2,297,301,301,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1"
,310,90,256,0,0,0,0,0,0,0,0,0,0,"Regular Element #10"
,311,90,512,0,1,0,310,310,0,0,0,0,0,"[Translate to Dansk:] Regular Element #10"
,312,90,768,0,2,0,311,311,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #10"
,320,-1,512,0,0,0,0,298,2,2,0,298,0,"Regular Element #2"
,321,89,416,0,1,298,298,298,1,1,0,0,0,"[Translate to Dansk:] Regular Element #2"
,322,-1,416,0,1,298,298,298,1,-1,0,321,0,"[Translate to Dansk:] Regular Element #2"
"tt_content",,,,,,,,,,,,,,,
,"uid","pid","sorting","hidden","deleted","sys_language_uid","l18n_parent","l10n_source","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header"
,296,88,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #0"
,297,89,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #1"
,298,89,512,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #2"
,299,89,768,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #3"
,300,89,1024,0,0,1,299,299,299,0,0,0,0,0,"[Translate to Dansk:] Regular Element #3"
,301,89,384,0,0,1,297,297,297,0,0,0,0,0,"[Translate to Dansk:] Regular Element #1"
,302,89,448,0,0,2,297,301,301,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1"
,310,90,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #10"
,311,90,512,0,0,1,0,310,310,0,0,0,0,0,"[Translate to Dansk:] Regular Element #10"
,312,90,768,0,0,2,0,311,311,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #10"
,320,-1,512,0,0,0,0,0,298,2,2,0,298,0,"Regular Element #2"
,321,89,416,0,0,1,298,298,298,1,1,0,0,0,"[Translate to Dansk:] Regular Element #2"
,322,-1,416,0,0,1,298,298,298,1,-1,0,321,0,"[Translate to Dansk:] Regular Element #2"
"tt_content",,,,,,,,,,,,,,,
,"uid","pid","sorting","hidden","deleted","sys_language_uid","l18n_parent","l10n_source","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header"
,296,88,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #0"
,297,89,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #1"
,298,89,512,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #2"
,299,89,768,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #3"
,300,89,1024,0,0,1,299,299,299,0,0,0,0,0,"[Translate to Dansk:] Regular Element #3"
,301,89,384,0,0,1,297,297,297,0,0,0,0,0,"[Translate to Dansk:] Regular Element #1"
,302,89,448,0,0,2,297,301,301,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1"
,310,90,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #10"
,311,90,512,0,0,1,0,310,310,0,0,0,0,0,"[Translate to Dansk:] Regular Element #10"
,312,90,768,0,0,2,0,311,311,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #10"
,320,-1,512,0,0,0,0,0,298,2,2,0,298,0,"Regular Element #2"
,321,89,416,1,0,1,298,298,298,1,1,0,0,0,"[Translate to Dansk:] Regular Element #2"
,322,-1,416,0,0,1,298,298,298,1,-1,0,321,0,"[Translate to Dansk:] Regular Element #2"