[BUGFIX] LocalizationStateSelector with new records 27/52127/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 22 Mar 2017 16:53:09 +0000 (17:53 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 22 Mar 2017 18:53:28 +0000 (19:53 +0100)
The LocalizationStateSelector field wizard on new, not yet persisted records
casts the ['databaseRow']['uid'] to integer which leads to 0 if the uid is
'NEW1234...'.

Example (wrong) field name in formEngine:
 data[pages_language_overlay][0][l10n_state][subtitle]
Should:
 data[pages_language_overlay][NEW1234][l10n_state][subtitle]

Thus, field wizards values different from default are not stored.
The patch changes the int cast to an htmlspecialchars() to transfer
correct record uid for new records, too.

Change-Id: Ic77bf1c1e5fc0ebfcf8837bf6848ab1a201852a4
Resolves: #80405
Releases: master
Reviewed-on: https://review.typo3.org/52127
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Form/FieldWizard/LocalizationStateSelector.php

index 8dd0f62..0f3f525 100644 (file)
@@ -75,7 +75,7 @@ class LocalizationStateSelector extends AbstractNode
         );
 
         $fieldElementName = 'data[' . htmlspecialchars($this->data['tableName']) . ']'
-            . '[' . (int)($this->data['databaseRow']['uid']) . ']'
+            . '[' . htmlspecialchars((string)$this->data['databaseRow']['uid']) . ']'
             . '[' . htmlspecialchars($l10nStateFieldName) . ']'
             . '[' . htmlspecialchars($this->data['fieldName']) . ']';