#98436Can't edit record (stuck) if hideDeleteIcon is set.
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
-
Gerrit Code Review pushed patch set 1 for main to change 84897 status
NewUnder Review 06/25/24, 10:46 -
Garvin Hicking commented 06/25/24, 10:48
-
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.
-
Gerrit Code Review pushed patch set 2 for main to change 84897 06/25/24, 10:55
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 84960 06/29/24, 13:00
-
Gerrit Code Review pushed patch set 1 for 11.5 to change 85012 06/29/24, 13:02
-
Garvin Hicking commented and changed status
Under ReviewResolved done0 %100 % 06/29/24, 13:15Applied in changeset commit:d37f0d8262211c9ae1340e68abbf53de989823f4.
-
Benni Mack changed status
ResolvedClosed 07/09/24, 12:46
This is actually a nasty bug. When this TCA config option is enabled, the HTML structure would NOT emit this HTML:
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.