Commit 7d92cdc8 authored by Oliver Hader's avatar Oliver Hader Committed by Nicole Cordes
Browse files

[FOLLOWUP][BUGFIX] Exception when setting "language" to "all" for content

The initial change just hid a misbehavior when dealing with a content
element that was defined for the non-existing "all language". In this
case no localizations are possible and the data-map item shall not be
considered at all. This change makes the exception on language "-1"
more explicit and does not hide these side-effects.

Besides that, the functional tests were extended to check the complete
scenario for the defined language to be tested in the frontend.

Change-Id: I336e0e5c3994e21b9b8a17818b3dc0ab1c2a1b3a
Resolves: #79853
Releases: master
Reviewed-on: https://review.typo3.org/51962


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Joerg Kummer's avatarJoerg Kummer <service@enobe.de>
Tested-by: Joerg Kummer's avatarJoerg Kummer <service@enobe.de>
Reviewed-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
parent e797b87f
......@@ -162,6 +162,11 @@ class DataMapProcessor
$fieldNames
);
// elements using "all language" cannot be localized
if ($item->getLanguage() === -1) {
unset($item);
continue;
}
// must be any kind of localization and in connected mode
if ($item->getLanguage() > 0 && empty($item->getParent())) {
unset($item);
......@@ -197,10 +202,6 @@ class DataMapProcessor
foreach ($this->filterItemsByType($type) as $item) {
foreach ($item->getApplicableScopes() as $scope) {
$fromId = $item->getIdForScope($scope);
if (empty($fromId)) {
continue;
}
$fieldNames = $this->getFieldNamesForItemScope($item, $scope, !$item->isNew());
$this->synchronizeTranslationItem($item, $fieldNames, $fromId);
}
......
......@@ -54,7 +54,7 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageIdSecond)->getResponseSections();
$this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
->setTable(self::TABLE_Content)->setField('header')->setValues('Language set to all'));
->setTable(self::TABLE_Content)->setField('header')->setValues('Language set to all', '[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1'));
}
/**
......
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
,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
,303,89,128,0,-1,0,0,0,0,0,0,0,0,Language set to all
\ No newline at end of file
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,l10n_state
,297,89,256,0,0,0,0,0,0,0,0,0,0,"Regular Element #1",\NULL
,298,89,512,0,0,0,0,0,0,0,0,0,0,"Regular Element #2",\NULL
,299,89,768,0,0,0,0,0,0,0,0,0,0,"Regular Element #3",\NULL
,300,89,1024,0,1,299,299,299,0,0,0,0,0,"[Translate to Dansk:] Regular Element #3",\NULL
,301,89,384,0,1,297,297,297,0,0,0,0,0,"[Translate to Dansk:] Regular Element #1",\NULL
,302,89,448,0,2,297,301,301,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1",\NULL
,303,89,128,0,-1,0,0,0,0,0,0,0,0,"Language set to all",\NULL
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment