[BUGFIX] Set opt-in for override checkbox in TCA input elements 86/56486/5
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 08:17:19 +0000 (10:17 +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/56486
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Alexander Stehlik <alexander.stehlik@gmail.com>
Tested-by: Alexander Stehlik <alexander.stehlik@gmail.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
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 d6c70af..85bf99b 100644 (file)
@@ -214,9 +214,6 @@ class InputColorPickerElement extends AbstractFormElement
                     );
                 }
             } else {
-                $fallbackValue = 1;
-                $checked = ' checked="checked"';
-                $disabled = ' disabled="disabled"';
                 $overrideLabel = $languageService->sL(
                     'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available'
                 );
index 3b300e8..bf83651 100644 (file)
@@ -231,9 +231,6 @@ class InputDateTimeElement extends AbstractFormElement
                     );
                 }
             } else {
-                $fallbackValue = 1;
-                $checked = ' checked="checked"';
-                $disabled = ' disabled="disabled"';
                 $overrideLabel = $languageService->sL(
                     'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available'
                 );
index 98bfe9a..3ad41f1 100644 (file)
@@ -265,9 +265,6 @@ class InputLinkElement extends AbstractFormElement
                     );
                 }
             } else {
-                $fallbackValue = 1;
-                $checked = ' checked="checked"';
-                $disabled = ' disabled="disabled"';
                 $overrideLabel = $languageService->sL(
                     'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available'
                 );
index bcaa51d..a433575 100644 (file)
@@ -265,9 +265,6 @@ class InputTextElement extends AbstractFormElement
                     );
                 }
             } else {
-                $fallbackValue = 1;
-                $checked = ' checked="checked"';
-                $disabled = ' disabled="disabled"';
                 $overrideLabel = $languageService->sL(
                     'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available'
                 );
index ca39498..786950d 100644 (file)
@@ -253,9 +253,6 @@ class TextElement extends AbstractFormElement
                     );
                 }
             } else {
-                $fallbackValue = 1;
-                $checked = ' checked="checked"';
-                $disabled = ' disabled="disabled"';
                 $overrideLabel = $languageService->sL(
                     'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available'
                 );