#111704FlexForm section container does not toggle when the sheet name contains a dot
Description
Sections in a FlexForm whose sheet key contains a dot (for example <sheet.tab1>) do not expand or collapse when the header is clicked. Adding an item works and the item renders, but the Bootstrap Collapse toggle does nothing.
Version: TYPO3 main (15.0.0-dev). Also reproduced on v14.3.12.
Steps to reproduce
- Create a FlexForm data structure with a dotted sheet key, for example
<sheet.tab1>, containing a section field. DCE generates sheet keys assheet.<tab variable>. - Create a new record of that type and click “Add” on the section field.
- Click the header of the added section item.
Expected: the section item expands.
Actual: nothing happens. The header button has:
data-bs-toggle="collapse"
data-bs-target="#flexform-section-container-sheet.tab1-pi_flexform-..."
Cause
Bootstrap parses data-bs-target as a CSS selector, where . means class. The section container DOM id is built from the raw sheet name in:
FlexFormSectionContainer($containerIdand$sectionContainerId)FlexFormContainerContainer($parentSectionContainer)
Only the flex form field name and the element base name are hashed. #109727 / change 93917 hashed the field name, but not the sheet name, so a dotted sheet name yields an invalid selector.
Fix
Hash the sheet name with HashAlgo::canonicalize()->hash() in these three places, the same way the field name and element base name are already handled. The DOM id is not persisted, so no data migration is needed.
Verification
The styleguide flex_2 fixture gets a dotted sheet key (sSection.dotted) and a Playwright test expands the section container.
- Before the fix: the test fails.
data-bs-targetkeeps the raw sheet name andaria-expandedstaysfalse. - After the fix: the test passes, and the existing dotted field name test still passes.
Reviews 1
Related issues 3
- #109727FlexForm IRRE section using like`settings.section` breaks backend (undefined array key + accordion not working)
- #110192Undefined array key in FormFlexAjaxController::containerAdd() on new records
- #110931FormEngine: file/inline records inside FlexForm fields cannot be expanded or collapsed (Bootstrap 5.3.2 regression)
History 34
-
Himanshu Ramavat changed Related to #109727 12/02/26, 10:00
-
Himanshu Ramavat changed Related to #110931 12/02/26, 10:01
-
Himanshu Ramavat changed Related to #110192 12/02/26, 10:01
-
Gerrit Code Review pushed patch set 1 for main to change 98277 status
NewUnder Review 12/02/26, 10:02