Issue Bug Closed

#110739Inline (IRRE) records in a flexform can't be expanded/collapsed when field name contains a `.`

Mike Street 09/18/26, 08:44 updated 11/10/26, 18:31

Description

[PLACEHOLDER TO GET AN ISSUE NUMBER – WILL BE UPDATED TODAY]

Reviews 2

History 711

  1. Mike Street commented <span data-processor="relativetime" data-value="2026-09-18T09:03:51+00:00" > 09/18/26, 09:03 </span>

    If you have a Flexform with inline records, the collapse/expand functionality doesn’t work for fields with a . inside them (e.g. settings.pages).

    This is because bootstap uses data-bs-target as a CSS selector pointing to an ID, so if it contains a dot it is assume it is 2 CSS classes concatenated.

    This can be resolved by escaping the data-bs-target in Classes/Form/Container/InlineRecordContainer.php around line 316 when it is building the container.

    This is an issue in both TYPO3 13 & 14.

    (Apologies for the placeholder Description above – I assume I would be able to update it afterwards)

    —-

    AI suggested a new function in that class to escape with regex (but could be in place)

    protected function escapeCssIdentifier(string $identifier): string
    {
        return preg_replace('/[^a-zA-Z0-9_-]/', '\\\\$0', $identifier);
    }

    And then updating the HTML being built

    - data-bs-toggle="collapse" data-bs-target="#' . $ariaControls . '"
    + data-bs-toggle="collapse" data-bs-target="#' . $this->escapeCssIdentifier($ariaControls) . '"
  2. Krystian Liński commented <span data-processor="relativetime" data-value="2026-09-18T12:24:45+00:00" > 09/18/26, 12:24 </span>

    One addition: FileReferenceContainer needs the same change. It builds the toggle the same way, around line 278, and both files got this markup in the same commit (075df31c6b).

    The panels also nest, so fixing only InlineRecordContainer is not enough: an inline record inside a FlexForm opens, but the file panels inside it stay closed, so you still cannot edit its images.

    Rather than duplicating the escaping in two containers, it could live in one place. Both extend AbstractContainer, and any future container with a collapse toggle would get it for free:

    --- a/Classes/Form/Container/AbstractContainer.php
    +    protected static function escapeSelector(string $identifier): string
    +    {
    +        return preg_replace('/[^A-Za-z0-9_-]/', '\\\\$0', $identifier) ?? $identifier;
    +    }
     // InlineRecordContainer and FileReferenceContainer
    - data-bs-target="#' . $ariaControls . '"
    + data-bs-target="#' . self::escapeSelector($ariaControls) . '"

    Only data-bs-target may be escaped: the panel id and aria-controls take an identifier rather than a selector, so they keep the raw value.

    Tested on 14.3.7. Both panels open again, and a normal inline record outside a FlexForm is unaffected, since the regex does nothing when the id has no dot.

  3. Mike Street commented <span data-processor="relativetime" data-value="2026-09-18T12:28:00+00:00" > 09/18/26, 12:28 </span>

    Thanks

    I created a patch and, upon doing so, Gerrit informed me it conflicts with this one which seems to remove the dot

    https://review.typo3.org/c/Packages/TYPO3.CMS/+/94596

    It also updates FileReferenceContainer as you mentioned.

    Happy to leave mine in favour of that one.

  4. Georg Ringer commented and changed status Under Review Closed <span data-processor="relativetime" data-value="2026-11-10T18:31:05+00:00" > 11/10/26, 18:31 </span>

    has been solved with #110071, therefore closing issue.

    if this is still valid for you in latest v14, please create a new issue!