Review main Abandoned

88367[BUGFIX] Re-use main record list endpoint for AJAX scope

Andreas Kienast CR 0 V 0 Normal +57 −80 updated 03/03/25, 13:21

Commit message

The AJAX endpoint introduced in #106241 has some flaws:

* the `ModuleData` object is not properly constructed, reflecting
  incomplete backend user configuration
* broken URLs are generated for clipboard actions hidden in the
  "..." menu
* the table for page translations contains additional controls that are
  prohibited
* the language selector is not updated after removing a localized page

The main reason for both issues is that there is a heavy reliance on the
passed `Request` object. Module data can only get composed if the
request is reflecting a backend module endpoint, and there is no factory
to compose this manually.

The actions for the clipboard are also generated based on the incoming
request. Using the introduced route hack in `DatabaseRecordList` is not
suitable here.

The dedicated AJAX endpoint has been removed again. AJAX handling is now
done in the main action which solves all the aforementioned issues.
However, we have to differentiate "regular" requests from AJAX requests.
Since the request object is used in underlying API to generate URLs, we
cannot safely add URL parameters. To circumvent this, the `Accept`
header is used here.

Small note: mixing endpoints for full page rendering and partial AJAX
handling is considered a smell and shall be avoided.

Review

  • Code review CR 0
  • Verified V 0

Issues 2

Files 5

Review log 1927

Show 2 earlier messages
  1. Andreas Kienast uploaded patch set 1 02/26/25, 15:18

  2. Andreas Kienast updated the commit message in patch set 2 02/26/25, 15:19

  1. Andreas Kienast uploaded patch set 3 02/26/25, 15:21

  2. Andreas Kienast uploaded patch set 4 02/26/25, 15:22

  3. core-ci voted on patch set 1 V +1 02/26/25, 15:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74769

  4. Andreas Kienast uploaded patch set 5 02/26/25, 15:27

  5. core-ci voted on patch set 2 V +1 02/26/25, 15:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74770

  6. Andreas Kienast uploaded patch set 6 02/26/25, 15:31

  7. Andreas Kienast uploaded patch set 7 02/26/25, 15:31

  8. core-ci voted on patch set 7 V +1 02/26/25, 15:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74775

  9. Andreas Kienast uploaded patch set 8 V +1 02/26/25, 15:54

  10. Andreas Kienast uploaded patch set 9 02/26/25, 15:57

  11. core-ci voted on patch set 8 V +1 02/26/25, 16:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74779

  12. core-ci voted on patch set 9 V +1 02/26/25, 16:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74782

  13. Andreas Kienast uploaded patch set 10 V +1 02/26/25, 19:35

  14. core-ci voted on patch set 10 V +1 02/26/25, 19:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74789

  15. Andreas Kienast rebased onto patch set 11 V +1 02/27/25, 07:26

  16. core-ci voted on patch set 11 V +1 02/27/25, 07:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74819

  17. Benjamin Franzke commented on patch set 11 02/28/25, 09:12

    recordlist.ts:403

    I'd prefer to utilize the `Accept: application/json` header
  18. Andreas Kienast commented on patch set 11 CR -1 02/28/25, 09:39

    on it

    recordlist.ts:403 Reply

    Acknowledged
  19. Andreas Kienast uploaded patch set 12 CR -1 V +1 02/28/25, 09:44

  20. core-ci voted on patch set 12 V +1 02/28/25, 09:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74886

  21. Christian Kuhn voted on patch set 12 CR +1 03/03/25, 12:02

  22. Benjamin Franzke commented on patch set 12 CR +1 V +1 03/03/25, 12:48

    I thought quite time about #106241 and would personally prefer a revert. On the other hand this fix is good for me as well and can be merged if you find enough votes ;) Why I think that #106241 should/could be reverted: * I don't see an imporvement in #106241 compared to a full reload (which would be less hacky to implement) – all state is lost anyway * Refreshing html-subareas is counter intuitive for end-users. State like selected checkbox is lost and it is hard to understand "what" is being reloaded (be have to reload notification) * We have two requests for one operation, if the second operation is slow, it could interfere with parallel user interaction (I managed to select a checkbox with 3G emulation while the delete request was running, which was then discarded after the second "refresh" request) * I think recordlist interactivity can only properly implemnted by a complete overhaul to client-side rendering. that's of course a long term goal, but I'd prefer if we do not put our time in "hacky" solutions like this one and instead concentrate on defining proper API's for the actions and response data that is needed. Anyway, as I said, you have my vote for merging this FIX in order to be back to a working state 🎉
  23. Christian Kuhn voted on patch set 12 V +1 03/03/25, 13:05

  24. Andreas Kienast abandoned the change 03/03/25, 13:10

    Going to revert the main patch.
  25. Andreas Kienast commented on patch set 12 03/03/25, 13:21