Review main Merged

87883[BUGFIX] Fix various issues in conjunction with `f:be.tableList`

Garvin Hicking CR +2 V +2 Normal +17 −46 updated 02/11/25, 12:54

Commit message

The Fluid ViewHelper `<f:be.tableList>` uses the
`sysext/backend/Classes/RecordList/DatabaseRecordList.php`
method `makeControl` to render a "Delete" button inside record lists.

Clicking on that link uses
`Build/Sources/TypeScript/backend/ajax-data-handler.ts` which localizes
the modal popup contents with either the strings of
`anchorElement.dataset.buttonCloseText` or `TYPO3.lang['button.cancel']`
as a fallback to return the string "Cancel".

When `<f:be.tableList>` is used In an extbase-based backend module
like EXT:belog/beuser/extensionmanager/indexed_search, that `TYPO3.lang`
fallback index is not available, and returns a JavaScript error:

```
VM7262 ajax-data-handler.js:13 Uncaught TypeError: Cannot read
 properties of undefined (reading 'button.cancel')
 at HTMLButtonElement.<anonymous> (VM7262 ajax-data-handler.js:13:1730)
 at HTMLDocument.<anonymous> (VM7215 regular-event.js:13:433)
```

To fix this, the `DatabaseRecordList::makeControl()` method now also
utilizes `data-button-close-text` in addition to `data-button-ok-text`,
so that the reliance on `TYPO3.lang` is no longer required.

All other methods in the TYPO3 Core which set `data-button-ok-text`
always also populate that `button-close-text` data attribute,
thus streamlining this behavior.

Additionally, multi-record deletion was completely dysfunctional as its
handling was tightly coupled to the Record List module. It turned out
this is not necessary as there's already a dedicated module handling
deletion, based on `AjaxDataHandler`. Said module is now used in the
regular record list, as in the view helper, fixing the broken handling
in the latter one. This supersedes the handling in
`@typo3/backend/recordlist`, which has been removed.

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Georg Ringer +1
    • Garvin Hicking +1
    • Markus Klein +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Georg Ringer +1
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 7

Review log 2732

Show 67 earlier messages
  1. Garvin Hicking uploaded patch set 1 01/25/25, 20:24

  2. core-ci voted on patch set 1 V +1 01/25/25, 20:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73002

  3. Georg Ringer voted on patch set 1 CR +1 V +1 01/25/25, 20:34

  4. Simon Schaufelberger voted on patch set 1 CR +1 V +1 01/25/25, 20:42

  5. Garvin Hicking commented on patch set 1 CR -1 01/25/25, 20:52

    Blocking this for the time being, I necessarily want @akienast@scripting-base.de to give feedback before merging.
  6. Florian E. commented on patch set 1 CR +1 01/26/25, 08:54

    Seems to work for me, but when I use the "Selection:" and press delete, I can only delete individual entries and not the selected records from the list. I'm not sure if this is the normal behavior.
  7. Garvin Hicking uploaded patch set 2 CR +1 V +1 01/26/25, 11:19

    Adjust for multi record deletion
  1. Garvin Hicking commented on patch set 2 CR -1 01/26/25, 11:20

    Reply

    Hhhhhm, there's another problem, yes. For multi-record deletion you need to delete the top right "Delete" button in the recordlist header. The trashcan icon next to a record is always only for a single record. This header delete icon though also throws a JavaScript error: ``` recordlist.js?bust=1737889280:13 Uncaught TypeError: Cannot read properties of undefined (reading 'button.close') at HTMLDocument.deleteMultiple (recordlist.js?bust=1737889280:13:5438) at HTMLButtonElement.<anonymous> (multi-record-selection.js?bust=1737889280:13:4417) at HTMLDocument.<anonymous> (regular-event.js?bust=1737889280:13:433)``` In recordlist.ts the label is accessed via: ``` TYPO3.lang['button.close'] ``` with no dataset attribute as the "first" fallback. I've now expanded the patch to take care of this, but it doesn't feel right to me to "prevent" accessing TYPO3.lang here with data attributes, instead of seeing how/if TYPO3.lang could be populated properly. ... staring at @akienast@scripting-base.de :-D ...
  2. core-ci voted on patch set 2 V +1 01/26/25, 11:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73021

  3. Simon Schaufelberger wrote 01/26/25, 11:28

    Removed reviewer Simon Schaufelberger.
  4. Andreas Kienast commented on patch set 2 CR -1 01/27/25, 09:12

    Reply

    @gh@faktor-e.de your case smells like a cache issue. I had that as well until I cleared my caches in Chrome.
    on it
  5. Andreas Kienast commented on patch set 2 01/27/25, 09:14

    Reply

    The reason deleting records doesn't work is the fact that the current(!) backend module URL is put into the rendered form wrapping the record list. This approach requires that the specific module implements a proper deletion handling.
  6. Andreas Kienast commented on patch set 2 CR -2 01/27/25, 10:11

    The implementation of the multi select handling is incomplete in record list. Will push heavier updates on this patch. Blocked for now.
  7. Andreas Kienast uploaded patch set 3 CR -1 V +1 01/27/25, 10:55

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  8. core-ci voted on patch set 3 V +1 01/27/25, 11:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73051

  9. Andreas Kienast updated the commit message in patch set 4 V +1 01/27/25, 11:01

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  10. Andreas Kienast voted on patch set 4 CR 0 01/27/25, 11:01

  11. Andreas Kienast commented on patch set 4 01/27/25, 11:01

    Reply

    Done

    Reply

    Done

    Reply

    Done
  12. core-ci voted on patch set 4 V +1 01/27/25, 11:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73052

  13. Garvin Hicking commented on patch set 4 01/28/25, 09:25

    Thanks @akienast@scripting-base.de - this seems to work well for me in both extbase and non-extbase backend modules. I tested single- and multi-record deletion and editing.
  14. Garvin Hicking commented on patch set 4 CR +1 V +1 01/28/25, 09:33

    Voting due to Andi's rework on this to indicate my thanks+approval ;)
  15. Georg Ringer voted on patch set 4 CR +1 V +1 01/29/25, 19:43

  16. Andreas Kienast voted on patch set 4 CR +2 V +2 01/31/25, 10:44

  17. Andreas Kienast commented on patch set 4 CR 0 V -1 01/31/25, 11:17

    Multi-select deleting from the record list now always reloads the whole backend...
  18. Andreas Kienast uploaded patch set 5 CR +1 V +1 01/31/25, 12:00

  19. Andreas Kienast commented on patch set 5 01/31/25, 12:01

    Reply

    Done
  20. core-ci voted on patch set 5 V +1 01/31/25, 12:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73260

  21. Markus Klein voted on patch set 5 CR +1 02/04/25, 07:57

  22. Garvin Hicking commented on patch set 5 CR +1 V +1 02/04/25, 08:12

    revote; multi-delect works for me (now)
  23. Georg Ringer voted on patch set 5 CR +1 V +1 02/10/25, 20:05

  24. Andreas Kienast voted on patch set 5 CR +2 V +2 02/11/25, 12:54

  25. Andreas Kienast merged patch set 6 02/11/25, 12:54