[BUGFIX] Set opt-in for override checkbox in TCA input elements 89/56989/2
authorTim Schreiner <schreiner.tim@gmail.com>
Thu, 29 Mar 2018 21:21:40 +0000 (23:21 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 17 May 2018 12:48:04 +0000 (14:48 +0200)
When useOrOverridePlaceholder mode is used for TCA input type,
use opt-in for the checkbox when placeholder is empty.

In some cases, the placeholder can be empty. Especially when the
placeholder uses data from another field. When information is added
to the corresponding field, the input field does not take this in account
because the override checkbox is set by default.

This can lead to problems for title and alternative fields in the
sys_file_metadata table. When adding a file reference and setting the
title or alternative field afterwards in the original file, the reference
is still using the empty override from file reference.

Resolves: #84563
Releases: master, 8.7
Change-Id: I84a37d55a48464b6249fc8bcee405a7cd909016a
Reviewed-on: https://review.typo3.org/56989
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Form/Element/InputColorPickerElement.php
typo3/sysext/backend/Classes/Form/Element/InputDateTimeElement.php
typo3/sysext/backend/Classes/Form/Element/InputLinkElement.php
typo3/sysext/backend/Classes/Form/Element/InputTextElement.php
typo3/sysext/backend/Classes/Form/Element/TextElement.php

index 7acd9b5..9123773 100644 (file)
@@ -218,9 +218,6 @@ class InputColorPickerElement extends AbstractFormElement
                     );
                 }
             } else {
-                $fallbackValue = 1;
-                $checked = ' checked="checked"';
-                $disabled = ' disabled="disabled"';
                 $overrideLabel = $languageService->sL(
                     'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available'
                 );
index 278f912..07ef87c 100644 (file)
@@ -235,9 +235,6 @@ class InputDateTimeElement extends AbstractFormElement
                     );
                 }
             } else {
-                $fallbackValue = 1;
-                $checked = ' checked="checked"';
-                $disabled = ' disabled="disabled"';
                 $overrideLabel = $languageService->sL(
                     'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available'
                 );
index 7fdcecb..b8620c5 100644 (file)
@@ -269,9 +269,6 @@ class InputLinkElement extends AbstractFormElement
                     );
                 }
             } else {
-                $fallbackValue = 1;
-                $checked = ' checked="checked"';
-                $disabled = ' disabled="disabled"';
                 $overrideLabel = $languageService->sL(
                     'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available'
                 );
index 4e291d4..6825114 100644 (file)
@@ -269,9 +269,6 @@ class InputTextElement extends AbstractFormElement
                     );
                 }
             } else {
-                $fallbackValue = 1;
-                $checked = ' checked="checked"';
-                $disabled = ' disabled="disabled"';
                 $overrideLabel = $languageService->sL(
                     'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available'
                 );
index ec5ade9..093cf60 100644 (file)
@@ -257,9 +257,6 @@ class TextElement extends AbstractFormElement
                     );
                 }
             } else {
-                $fallbackValue = 1;
-                $checked = ' checked="checked"';
-                $disabled = ' disabled="disabled"';
                 $overrideLabel = $languageService->sL(
                     'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available'
                 );