Bug #87781
closedTCA type='none' throws InvalidFieldNameException when saving translated record
100%
Description
I've added a field help
with TCA type='none'
to display some custom help text in the Backend.
$GLOBALS['TCA']['tt_content']['columns']['help'] = [ 'label' => 'Help', 'l10n_mode' => 'exclude', 'config' => [ 'type' => 'none', 'renderType' => 'myCustomHelpRenderType', ], ];
Records in default language just work as expected.
Translated records can't be saved:
Doctrine\DBAL\Exception\InvalidFieldNameException: ... Unknown column 'help' in 'field list'
Current behavior: DataHandler tries to synch the type='none'
field with TYPO3\CMS\Core\DataHandling\Localization\DataMapProcessor->synchronizeTranslationItem().
Expected behavior (see TCAReference https://docs.typo3.org/typo3cms/TCAReference/ColumnsConfig/Type/None.html):
- The DataHandler discards values send for type none and never persists or updates them in the database.
- Type none is the only type that does not necessarily need a database field.
Quick and dirty "fix": Add the database field (tt_content.help
).
Updated by Gerrit Code Review about 5 years 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/c/Packages/TYPO3.CMS/+/61960
Updated by Gerrit Code Review about 5 years 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/c/Packages/TYPO3.CMS/+/61960
Updated by Gerrit Code Review about 5 years 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/c/Packages/TYPO3.CMS/+/61960
Updated by Oliver Hader about 5 years ago
Why is l10n_mode
set in the first place on a value that shall not be persisted?
Probably displayCond
was meant to avoid showing this field on localized records, correct?
Updated by Georg Tiefenbrunn about 5 years ago
Oliver Hader wrote:
Probably
displayCond
was meant to avoid showing this field on localized records, correct?
Correct, thanks a lot!
https://docs.typo3.org/m/typo3/reference-tca/master/en-us/Columns/Index.html#l10n-mode
exclude Field will not be shown in FormEngine if this record is a localization of the default language. Works basically like a display condition. Internally, the field value of the default language record is copied over to the field of the localized record. ...
What's next?
a) Don't set 'l10n_mode' => 'exclude'
for 'type' => 'none'
(= Update the docs)
b) Force DataHandler to discard data if 'type' => 'none'
(= The DataHandler discards values send for type none and never persists or updates them in the database.)
Updated by Gerrit Code Review almost 5 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62980
Updated by Christian Eßl almost 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset af2cfd4a46ef4503c39eb0f62ea6f76c950cc942.