Bug #86734

not possible to edit pages with sys_language_uid > 9 with SiteHandling

Added by Sven Juergens 5 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2018-10-24
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint

Description

hi,

I have a system with 10 languages ​​and several RootPages. Each RootPage has the default language and a translation.
The languages ​​are assigned via sitehandling.
If I assign a Rootpage the language 10 I can not edit these over the module "Pages" and get the following error message

(1/1) #1522960188 InvalidArgumentException
Language 1 does not exist on site xx.

I would like to edit the language with the UID 10, but get the error message the language with the Uid 1 is not available.
The Error is in \TYPO3\CMS\Backend\Form\Element\InputSlugElement::class (InputSlugElement.php) on line 67:

66 - $languageField = $GLOBALS['TCA'][$table]['ctrl']['languageField'];
67 - $languageId = (int)($row[$languageField][0] ?? 0);
68 - $baseUrl = $this->getPrefix($this->data['site'], $languageId);

$languageField is for table pages 'sys_language_uid' and $row has

$row[
  ...
   'sys_language_uid' = 10
 ...
]; 

so with line 67 we get only the '1' instead of '10'

so line 67 sould changed to:

67 - $languageId = (int)($row[$languageField] ?? 0);


Related issues

Related to TYPO3 Core - Bug #86754: OverrideVals are not always set for editing pages Resolved 2018-10-26
Duplicated by TYPO3 Core - Bug #86554: Field value does not get converted to array if using overrideVals Resolved 2018-10-03

Associated revisions

Revision 87fae8bc (diff)
Added by Daniel Goerz 5 months ago

[BUGFIX] Allow editing of pages with language ID > 9

Resolves: #86734
Releases: master
Change-Id: Ib26c0336531e1e692f73ccc431b7091c47755ce9
Reviewed-on: https://review.typo3.org/58696
Tested-by: TYPO3com <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

Revision c26facec (diff)
Added by Daniel Goerz 5 months ago

[BUGFIX] Also process array in InputSlugElement

It is possible that the incoming $row contains an array
at the $languageField. This patch assures that the
$languageId can always be determined.

Resolves: #86734
Resolves: #86554
Relates: #86754
Releases: master
Change-Id: Ia2c8621cd935788f33a9b625ec0226a22e21b123
Reviewed-on: https://review.typo3.org/58700
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Tested-by: TYPO3com <>
Reviewed-by: Oliver Hader <>
Tested-by: Oliver Hader <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>

History

#1 Updated by Sven Juergens 5 months ago

  • Category set to Link Handling, Site Handling & Routing

#2 Updated by Joerg Kummer 5 months ago

Is this related to #86662?

#3 Updated by Susanne Moog 5 months ago

  • Sprint Focus set to On Location Sprint

#4 Updated by Gerrit Code Review 5 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58696

#5 Updated by Anonymous 5 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#6 Updated by Susanne Moog 5 months ago

  • Duplicated by Bug #86554: Field value does not get converted to array if using overrideVals added

#7 Updated by Gerrit Code Review 5 months ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58700

#8 Updated by Gerrit Code Review 5 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58700

#9 Updated by Gerrit Code Review 5 months ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58700

#10 Updated by Daniel Goerz 5 months ago

This bug pointed to a different issue that lies a bit deeper.

The value of the sys_language_uid field of the pages table is an array if properly processed by formEnging (see TcaSelectItems).

However, since the removal of pages_language_overlay the sys_language_uid is passed as overrideVals to the formEngine (GET parameter overrideVals[pages][sys_langauge_uid]). This was streamlines in the core with #86754.

In case overrideVals are set, the TcaSelectItems will NOT process the field sys_language_uid because the type is set to hidden during runtime. This results in the value arriving in the InputSlugElement will not be an array.

Since it is still possible for a custom edit functionality to not set the overrideVals, the InputSlugElement needs to be able to handle both cases.

How can you test this?

Edit a page with and without the overrideVals GET parameter and check that the InputSlugElement determines the ID correctly in both cases.

#11 Updated by Anja Leichsenring 5 months ago

  • Related to Bug #86754: OverrideVals are not always set for editing pages added

#12 Updated by Gerrit Code Review 5 months ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58700

#13 Updated by Gerrit Code Review 5 months ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58700

#14 Updated by Anonymous 5 months ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF