Skip to content

Commit

Permalink
[BUGFIX] Fix hide/unhide inline control for a special case
Browse files Browse the repository at this point in the history
In case an inline field doesn't define the "disabled" column
in its "showitem" list, a hidden checkbox is now rendered in
the expanded state. This is the same checkbox, which is
rendered, when the inline item is initially visited in the
collapsed state.

Resolves: #98353
Releases: main, 11.5
Change-Id: I9b8b65c359f34aff9c6bad64e0d7b0870cbd259d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75651
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
  • Loading branch information
nhovratov authored and sbuerk committed Sep 16, 2022
1 parent bc3d79e commit e657753
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -153,12 +153,12 @@ public function render()
// Set additional field for processing for saving
$html .= '<input type="hidden" name="cmd' . htmlspecialchars($appendFormFieldNames)
. '[delete]" value="1" disabled="disabled" />';
if (!$data['isInlineChildExpanded'] && !empty($hiddenField)) {
if (!empty($hiddenField) && (!$data['isInlineChildExpanded'] || !in_array($hiddenField, $data['columnsToProcess'], true))) {
$checked = !empty($record[$hiddenField]) ? ' checked="checked"' : '';
$html .= '<input type="checkbox" data-formengine-input-name="data'
$html .= '<input type="checkbox" class="d-none" data-formengine-input-name="data'
. htmlspecialchars($appendFormFieldNames)
. '[' . htmlspecialchars($hiddenField) . ']" value="1"' . $checked . ' />';
$html .= '<input type="input" name="data' . htmlspecialchars($appendFormFieldNames)
$html .= '<input type="input" class="d-none" name="data' . htmlspecialchars($appendFormFieldNames)
. '[' . htmlspecialchars($hiddenField) . ']" value="' . htmlspecialchars($record[$hiddenField]) . '" />';
}
}
Expand Down

0 comments on commit e657753

Please sign in to comment.