[FEATURE] Introduce allowLanguageSynchronization
This feature introduces a new functionality called "allowLanguageSynchronization" which can be set on a field configuration of a TCA column. This is the successor of "l10n_mode=mergeIfNotBlank" as the old option had several conceptual downsides: 1) "mergeIfNotBlank" took the value of the default record during runtime, but only if the translation field was empty. This means it was not possible to see what the record actually contained without having all fields of the parent at hand. 2) It was not possible to have a value "santa" in the original record but remove the option in a translation (because an empty string "" implicitly triggered the runtime call in the frontend) 3) "mergeIfNotBlank" did not work on relations except for files fetched via the FileRepository API calls, but for no other inline elements. 4) "mergeIfNotBlank" did the overlay functionality in the frontend, but only FormEngine and DataHandler took care of the option. Custom backend modules had to implement the same functionality. 5) In FormEngine, there was an icon in the translation record that if the record kept empty the value of the original language was taken, but this is not optimal in terms of usability. 6) "mergeIfNotBlank" did not take the new l10n_source option into account, where localizations could be made from other records than the default language "0". The new feature can be set on any TCA column setting: $GLOBALS['TCA'][<table-name>]['columns'] [<field-name>]['config']['behaviour'] ['allowLanguageSynchronization'] = true; This brings an option to records with translations (both from l10n_parent and l10n_source) to have the value for all translations synchronized or explictly have a checkbox to use a custom value. The information whether a field is custom filled, or kept in sync from l10n_parent/l10n_source is stored in a separate field called "l10n_state" inside the database. The introduced upgrade wizard and TCA migration to remove "l10n_mode=mergeIfNotBlank" has been modified to migrate to this option and add a l10n_state database field if a TCA table used "mergeIfNotBlank" but did not add the l10n_state field manually via ext_tables.sql yet. New extensions can easily use the new option right away, extensions that need to stay compatible with v7 and v8 can add both options right away to have the same output. The main goals to achieve with this change is now: * Have consistent database values for all records regardless of l10n_mode=mergeIfNotBlank paving the way to fetch translated records without having to overlay (once l10n_mode=exclude is also copying values and relations) * Be more explicit for editors about records that have a different or the same state as their l10n_parent/l10n_source as a benefit for bigger instances with a lot of languages * Avoid hidden magic when retrieving localized records in the TYPO3 Frontend. Resolves: #79658 Related: #79243 Releases: master Change-Id: I6c2dbfeb09b47f958a536c9ab050c24ba4bbcbbd Reviewed-on: https://review.typo3.org/51291 Tested-by:TYPO3com <no-reply@typo3.com> Reviewed-by:
Frans Saris <franssaris@gmail.com> Tested-by:
Frans Saris <franssaris@gmail.com> Reviewed-by:
Georg Ringer <georg.ringer@gmail.com> Tested-by:
Georg Ringer <georg.ringer@gmail.com> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch>
Showing
- typo3/sysext/backend/Classes/Form/Container/InlineControlContainer.php 14 additions, 0 deletions...backend/Classes/Form/Container/InlineControlContainer.php
- typo3/sysext/backend/Classes/Form/Element/CheckboxElement.php 6 additions, 0 deletions...3/sysext/backend/Classes/Form/Element/CheckboxElement.php
- typo3/sysext/backend/Classes/Form/Element/GroupElement.php 5 additions, 1 deletiontypo3/sysext/backend/Classes/Form/Element/GroupElement.php
- typo3/sysext/backend/Classes/Form/Element/ImageManipulationElement.php 6 additions, 0 deletions...backend/Classes/Form/Element/ImageManipulationElement.php
- typo3/sysext/backend/Classes/Form/Element/InputColorPickerElement.php 6 additions, 0 deletions.../backend/Classes/Form/Element/InputColorPickerElement.php
- typo3/sysext/backend/Classes/Form/Element/InputDateTimeElement.php 6 additions, 0 deletions...ext/backend/Classes/Form/Element/InputDateTimeElement.php
- typo3/sysext/backend/Classes/Form/Element/InputLinkElement.php 9 additions, 3 deletions.../sysext/backend/Classes/Form/Element/InputLinkElement.php
- typo3/sysext/backend/Classes/Form/Element/InputTextElement.php 6 additions, 0 deletions.../sysext/backend/Classes/Form/Element/InputTextElement.php
- typo3/sysext/backend/Classes/Form/Element/RadioElement.php 6 additions, 0 deletionstypo3/sysext/backend/Classes/Form/Element/RadioElement.php
- typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxElement.php 6 additions, 0 deletions...xt/backend/Classes/Form/Element/SelectCheckBoxElement.php
- typo3/sysext/backend/Classes/Form/Element/SelectMultipleSideBySideElement.php 6 additions, 0 deletions.../Classes/Form/Element/SelectMultipleSideBySideElement.php
- typo3/sysext/backend/Classes/Form/Element/SelectSingleBoxElement.php 6 additions, 0 deletions...t/backend/Classes/Form/Element/SelectSingleBoxElement.php
- typo3/sysext/backend/Classes/Form/Element/SelectSingleElement.php 7 additions, 1 deletion...sext/backend/Classes/Form/Element/SelectSingleElement.php
- typo3/sysext/backend/Classes/Form/Element/TextElement.php 6 additions, 0 deletionstypo3/sysext/backend/Classes/Form/Element/TextElement.php
- typo3/sysext/backend/Classes/Form/Element/TextTableElement.php 6 additions, 0 deletions.../sysext/backend/Classes/Form/Element/TextTableElement.php
- typo3/sysext/backend/Classes/Form/FieldWizard/LocalizationStateSelector.php 141 additions, 0 deletions...nd/Classes/Form/FieldWizard/LocalizationStateSelector.php
- typo3/sysext/backend/Classes/Form/FormDataCompiler.php 3 additions, 0 deletionstypo3/sysext/backend/Classes/Form/FormDataCompiler.php
- typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseLanguageRows.php 16 additions, 0 deletions...nd/Classes/Form/FormDataProvider/DatabaseLanguageRows.php
- typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseRecordTypeValue.php 2 additions, 27 deletions...Classes/Form/FormDataProvider/DatabaseRecordTypeValue.php
- typo3/sysext/backend/Classes/Form/NodeFactory.php 1 addition, 0 deletionstypo3/sysext/backend/Classes/Form/NodeFactory.php
Please register or sign in to comment