diff --git a/typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php b/typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php index 8001442602d932cd61f3bfbcf1dcef3d6a071950..b3c681e145b4287c0872bd2dc94c3adfa4ed7635 100644 --- a/typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php @@ -101,7 +101,7 @@ abstract class AbstractFormElement extends AbstractNode { /** * Rendering wizards for form fields. * - * @param array $itemKinds Array with the real item in the first value, and an alternative item in the second value. + * @param array $itemKinds Array with the real item in the first value * @param array $wizConf The "wizard" key from the config array for the field (from TCA) * @param string $table Table name * @param array $row The record array @@ -405,34 +405,10 @@ abstract class AbstractFormElement extends AbstractNode { $otherWizards[] = $suggestWizard->renderSuggestSelector($PA['itemFormElName'], $table, $field, $row, $PA); break; } - - // Hide the real form element? - if (is_array($wizardConfiguration['hideParent']) || $wizardConfiguration['hideParent']) { - // Setting the item to a hidden-field. - $item = $itemKinds[1]; - if (is_array($wizardConfiguration['hideParent'])) { - $options = $this->globalOptions; - $options['parameterArray'] = array( - 'fieldConf' => array( - 'config' => $wizardConfiguration['hideParent'], - ), - 'itemFormElValue' => $PA['itemFormElValue'], - ); - $options['renderType'] = 'none'; - /** @var NodeFactory $nodeFactory */ - $nodeFactory = $this->globalOptions['nodeFactory']; - $noneElementResult = $nodeFactory->create($options)->render(); - $item .= $noneElementResult['html']; - } - } } // For each rendered wizard, put them together around the item. if (!empty($buttonWizards) || !empty($otherWizards)) { - if ($wizConf['_HIDDENFIELD']) { - $item = $itemKinds[1]; - } - $innerContent = ''; if (!empty($buttonWizards)) { $innerContent .= '<div class="btn-group' . ($wizConf['_VERTICAL'] ? ' btn-group-vertical' : '') . '">' . implode('', $buttonWizards) . '</div>'; diff --git a/typo3/sysext/backend/Classes/Form/Element/GroupElement.php b/typo3/sysext/backend/Classes/Form/Element/GroupElement.php index c3278fd5a8e43c3999dd3636a85a9fcf8226077c..ab34e4e9c94ee5c31332191e2c6b7ff072307ee3 100644 --- a/typo3/sysext/backend/Classes/Form/Element/GroupElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/GroupElement.php @@ -324,13 +324,9 @@ class GroupElement extends AbstractFormElement { break; } // Wizards: - $altItem = '<input type="hidden" name="' . $parameterArray['itemFormElName'] . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />'; if (!$disabled) { $html = $this->renderWizards( - array( - $html, - $altItem - ), + array($html), $config['wizards'], $table, $row, diff --git a/typo3/sysext/backend/Classes/Form/Element/InputElement.php b/typo3/sysext/backend/Classes/Form/Element/InputElement.php index 8186a772ee886d4cc7c2dd12d8de848a9365793a..bb319c6137f777ee02c01ef24d5205dc0067c031 100644 --- a/typo3/sysext/backend/Classes/Form/Element/InputElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/InputElement.php @@ -228,14 +228,9 @@ class InputElement extends AbstractFormElement { </div>'; } - // Creating an alternative item without the JavaScript handlers. - $altItem = ' - <input type="hidden" name="' . htmlspecialchars($parameterArray['itemFormElName']) . '_hr" value="" /> - <input type="hidden" name="' . htmlspecialchars($parameterArray['itemFormElName']) . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />'; - // Wrap a wizard around the item? $html = $this->renderWizards( - array($html, $altItem), + array($html), $config['wizards'], $table, $row, diff --git a/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxElement.php b/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxElement.php index 0c2bd924c57200f8c4fe151f20bde9a1d393a0e6..a24dc3e54aca35b364d3e33fe11eb8f52b2b3d6a 100644 --- a/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxElement.php @@ -61,8 +61,7 @@ class SelectCheckBoxElement extends AbstractFormElement { // Wizards: if (!$disabled) { - $altItem = '<input type="hidden" name="' . $parameterArray['itemFormElName'] . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />'; - $html = $this->renderWizards(array($html, $altItem), $config['wizards'], $table, $row, $field, $parameterArray, $parameterArray['itemFormElName'], $specConf); + $html = $this->renderWizards(array($html), $config['wizards'], $table, $row, $field, $parameterArray, $parameterArray['itemFormElName'], $specConf); } $this->resultArray['html'] = $html; return $this->resultArray; diff --git a/typo3/sysext/backend/Classes/Form/Element/SelectMultipleSideBySideElement.php b/typo3/sysext/backend/Classes/Form/Element/SelectMultipleSideBySideElement.php index 8ac89e3a66fa35e677d9a2c901294ca93a665841..0d44f760654e67d0241881f979a5e40b439d36e5 100644 --- a/typo3/sysext/backend/Classes/Form/Element/SelectMultipleSideBySideElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/SelectMultipleSideBySideElement.php @@ -63,8 +63,7 @@ class SelectMultipleSideBySideElement extends AbstractFormElement { // Wizards: if (!$disabled) { - $altItem = '<input type="hidden" class="t3js-select-hidden-field" name="' . $parameterArray['itemFormElName'] . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />'; - $html = $this->renderWizards(array($html, $altItem), $config['wizards'], $table, $row, $field, $parameterArray, $parameterArray['itemFormElName'], $specConf); + $html = $this->renderWizards(array($html), $config['wizards'], $table, $row, $field, $parameterArray, $parameterArray['itemFormElName'], $specConf); } $this->resultArray['html'] = $html; return $this->resultArray; diff --git a/typo3/sysext/backend/Classes/Form/Element/SelectSingleBoxElement.php b/typo3/sysext/backend/Classes/Form/Element/SelectSingleBoxElement.php index cc3ff3735b351c00ec21cc361bd50a726d569bfe..1f0cb89e2ca3eeea50dd4d5679a0cdc5e8be5a9b 100644 --- a/typo3/sysext/backend/Classes/Form/Element/SelectSingleBoxElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/SelectSingleBoxElement.php @@ -62,8 +62,7 @@ class SelectSingleBoxElement extends AbstractFormElement { // Wizards: if (!$disabled) { - $altItem = '<input type="hidden" name="' . $parameterArray['itemFormElName'] . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />'; - $html = $this->renderWizards(array($html, $altItem), $config['wizards'], $table, $row, $field, $parameterArray, $parameterArray['itemFormElName'], $specConf); + $html = $this->renderWizards(array($html), $config['wizards'], $table, $row, $field, $parameterArray, $parameterArray['itemFormElName'], $specConf); } $this->resultArray['html'] = $html; return $this->resultArray; diff --git a/typo3/sysext/backend/Classes/Form/Element/SelectSingleElement.php b/typo3/sysext/backend/Classes/Form/Element/SelectSingleElement.php index 4001e7703ddd7a33c583daff839c375e9d642690..d46fd272f3eb6355e69b258368a2d010b38d0153 100644 --- a/typo3/sysext/backend/Classes/Form/Element/SelectSingleElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/SelectSingleElement.php @@ -65,8 +65,7 @@ class SelectSingleElement extends AbstractFormElement { // Wizards: if (!$disabled) { - $altItem = '<input type="hidden" name="' . $parameterArray['itemFormElName'] . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />'; - $html = $this->renderWizards(array($html, $altItem), $config['wizards'], $table, $row, $field, $parameterArray, $parameterArray['itemFormElName'], $specConf); + $html = $this->renderWizards(array($html), $config['wizards'], $table, $row, $field, $parameterArray, $parameterArray['itemFormElName'], $specConf); } $this->resultArray['html'] = $html; return $this->resultArray; diff --git a/typo3/sysext/backend/Classes/Form/Element/SelectTreeElement.php b/typo3/sysext/backend/Classes/Form/Element/SelectTreeElement.php index d697f5fff3ffeda4a46701d7812fb9d9ed3af1ab..b00c90755307da91bc81e617524a0bc908615ac4 100644 --- a/typo3/sysext/backend/Classes/Form/Element/SelectTreeElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/SelectTreeElement.php @@ -62,8 +62,7 @@ class SelectTreeElement extends AbstractFormElement { // Wizards: if (!$disabled) { - $altItem = '<input type="hidden" name="' . $parameterArray['itemFormElName'] . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />'; - $html = $this->renderWizards(array($html, $altItem), $config['wizards'], $table, $row, $field, $parameterArray, $parameterArray['itemFormElName'], $specConf); + $html = $this->renderWizards(array($html), $config['wizards'], $table, $row, $field, $parameterArray, $parameterArray['itemFormElName'], $specConf); } $resultArray['html'] = $html; return $resultArray; diff --git a/typo3/sysext/backend/Classes/Form/Element/TextElement.php b/typo3/sysext/backend/Classes/Form/Element/TextElement.php index 7e93bca09a38c0e45dfc2056801df8ad76dc6aab..36474e9a449f85e1e6525cd431e54ca86c59e897 100644 --- a/typo3/sysext/backend/Classes/Form/Element/TextElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/TextElement.php @@ -92,8 +92,6 @@ class TextElement extends AbstractFormElement { $evalList = GeneralUtility::trimExplode(',', $config['eval'], TRUE); // "Extra" configuration; Returns configuration for the field based on settings found in the "types" fieldlist. Traditionally, this is where RTE configuration has been found. $specialConfiguration = BackendUtility::getSpecConfParts($parameterArray['fieldConf']['defaultExtras']); - // Setting up the altItem form field, which is a hidden field containing the value - $altItem = '<input type="hidden" name="' . htmlspecialchars($parameterArray['itemFormElName']) . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />'; $html = ''; // Show message, if no RTE (field can only be edited with RTE!) @@ -178,7 +176,7 @@ class TextElement extends AbstractFormElement { // Wrap a wizard around the item? $html = $this->renderWizards( - array($html, $altItem), + array($html), $config['wizards'], $table, $row, diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-68092-TcaRemoveWizardHideParent.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-68092-TcaRemoveWizardHideParent.rst new file mode 100644 index 0000000000000000000000000000000000000000..7ef98fa8f14c076b044c4f9b7e0ed3492ad3928a --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-68092-TcaRemoveWizardHideParent.rst @@ -0,0 +1,49 @@ +================================================================= +Breaking: #68092 - TCA: Remove wizard hideParent and _HIDDENFIELD +================================================================= + +Description +=========== + +Wizards defined in ``TCA`` for display in ``FormEngine`` allowed to hide the "parent" +field with the configuration options ``_HIDDENFIELD`` on main wizard level, and with +the ``hideParent`` option for single wizards. + +Both options have been dropped. + + +Impact +====== + +The configuration options have no effect anymore, the main field will show up. + + +Affected Installations +====================== + +A search through the TER code showed not a single extension that used the above options. +A 3rd party extension is affected if a ``TCA`` column configuration is used like: + +.. code-block:: php + + 'aField' => array( + 'config' => array( + ... + 'wizards' => array( + '_HIDDENFIELD' => TRUE, + 'aWizard' => array( + 'hideParent' => array( + ... + ), + ), + ), + ), + ), + + +Migration +========= + +Wizards can not trigger that a main field is not rendered anymore. If this kind of functionality +is needed, it is recommended to register an own ``renderType`` in the ``NodeFactory`` for this +type of field instead to route the element rendering to an own class. \ No newline at end of file diff --git a/typo3/sysext/rtehtmlarea/Classes/Form/Element/RichTextElement.php b/typo3/sysext/rtehtmlarea/Classes/Form/Element/RichTextElement.php index 2b209ceca2784aa3d78b5ad4e15547322830d352..46ed9a9a59025156dbef42505d058b691fe296e3 100644 --- a/typo3/sysext/rtehtmlarea/Classes/Form/Element/RichTextElement.php +++ b/typo3/sysext/rtehtmlarea/Classes/Form/Element/RichTextElement.php @@ -271,10 +271,7 @@ class RichTextElement extends AbstractFormElement { $html = $this->getMainHtml(); $this->resultArray['html'] = $this->renderWizards( - array( - $html, - '<input type="hidden" name="' . htmlspecialchars($parameterArray['itemFormElName']) . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />', - ), + array($html), $parameterArray['fieldConf']['config']['wizards'], $table, $row,