Issue Bug Closed

#98436Can't edit record (stuck) if hideDeleteIcon is set.

Christian Toffolo 09/26/22, 10:04 updated 07/09/24, 12:46

Description

JS console error:
@Uncaught TypeError: Cannot read properties of null (reading ‘classList’)@

Step to reproduce:
- just add 'hideDeleteIcon' => true to, by example, field shortcut of pages TCA
- try to edit a Page record of type shortcut
- check the JS console

Reviews 3

History 48

  1. Gerrit Code Review pushed patch set 1 for main to change 84897 status New Under Review 06/25/24, 10:46

  2. Garvin Hicking commented 06/25/24, 10:48

    This is actually a nasty bug. When this TCA config option is enabled, the HTML structure would NOT emit this HTML:

    $html[] =       '<div class="form-wizards-items-aside form-wizards-items-aside--move">';
    $html[] =           '<div class="btn-group-vertical">';

    but CLOSE it afterwards. This leads to a malformed HTML construct. In your v11 case this seems to lead to a javascript error. In my v12 and v13 environment it actually leads to being unable to save the record at all. Any changes to the record in FormEngine will not have an effect, and content will not be saved.

  3. Garvin Hicking commented 06/25/24, 10:52

    I reproduced this in v12 and v13 by adding this to a sitepackage extension:

        $GLOBALS['TCA']['pages']['columns']['shortcut']['config']['hideDeleteIcon'] = true;

    and then editing the record in the backend on any page of type “shortcut”. With the applied TCA, no data is persisted at all. Removing the TCA assignment will lead to a proper HTML structure.

  4. Gerrit Code Review pushed patch set 2 for main to change 84897 06/25/24, 10:55

  5. Gerrit Code Review pushed patch set 1 for 12.4 to change 84960 06/29/24, 13:00

  6. Gerrit Code Review pushed patch set 1 for 11.5 to change 85012 06/29/24, 13:02

  7. Garvin Hicking commented and changed status Under Review Resolved done 0 % 100 % 06/29/24, 13:15

    Applied in changeset commit:d37f0d8262211c9ae1340e68abbf53de989823f4.

  8. Benni Mack changed status Resolved Closed 07/09/24, 12:46