From 46e98d4a3678bf244858189cec30257fd2ad3e81 Mon Sep 17 00:00:00 2001 From: Ingolf Steinhardt Date: Fri, 29 Nov 2024 19:50:58 +0100 Subject: [PATCH] Fix be template for open/hide legends --- src/Resources/contao/templates/dcbe_general_edit.html5 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Resources/contao/templates/dcbe_general_edit.html5 b/src/Resources/contao/templates/dcbe_general_edit.html5 index 954051a2..abaa914a 100644 --- a/src/Resources/contao/templates/dcbe_general_edit.html5 +++ b/src/Resources/contao/templates/dcbe_general_edit.html5 @@ -90,7 +90,13 @@ $GLOBALS['TL_CSS']['cca.dc-general.generalDriver'] = '/bundles/ccadcgeneral/css/ fieldsets as $arrFieldset): $paletteId = 'pal_' . StringUtil::specialchars($arrFieldset['legend']); - $class = $arrFieldset['class'] . (($fieldsetStates[$this->table][$paletteId] ?? null) ? '' : ' collapsed'); + $class = $arrFieldset['class']; + if (null !== ($fieldsetState = ($fieldsetStates[$this->table][$paletteId] ?? null))) { + $class = \str_replace(' collapsed', '', $class); + if (0 === $fieldsetState) { + $class .= ' collapsed'; + } + } if($arrFieldset['legend'] ?? null): ?>