Review main Merged

93596[BUGFIX] Render database forms in frontend without BE user requirement

Stefan Bürk CR +2 V +2 Easy +19 −8 updated 04/09/26, 20:02

Commit message

With #108653 new database based storage for `EXT:form` has
been introduced and permission restricted with #109346,
originally targeting `BE` permission checks.

This leads to not renderable forms in the frontend in case
no backend user is logged in for that domain having proper
read permissions and making `EXT:forms` on casual websites
for anonymous visitors unusable and leading to following
exception:

 (1/1) #1529710560 TYPO3\CMS\Form\Domain\Exception\RenderingException
 Access denied: You do not have permission to access forms on page "0".
 in
 core-main/typo3/sysext/form/Classes/Domain/Factory/ArrayFormFactory.php
 line 70

hidden behind the common `Oops, an error occurred.` for
the plugin.

This change now checks for frontend request type in
`DatabasePermissionChecker->hasReadPermission()` to
return `true` in that case and make forms usable
again.

This resolves a regression for the whole feature, but
**should** be investigated if the request could not
be passed down through the api's or if a better place
to handle different permission check requirements for
BE, FE or CLI contexts.

Review

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

Issues 3

Files 5

Review log 1117

  1. Stefan Bürk uploaded patch set 1 04/09/26, 10:00

  2. Stefan Bürk updated the commit message in patch set 2 04/09/26, 10:01

  3. core-ci voted on patch set 1 V +1 04/09/26, 10:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99835

  4. core-ci voted on patch set 2 V +1 04/09/26, 10:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99836

  5. Josua Vogel uploaded patch set 3 V +1 04/09/26, 11:24

  6. Stefan Bürk commented on patch set 3 04/09/26, 11:30

    StorageAdapterInterface.php:113

    This needs to be discussed.
  7. core-ci voted on patch set 3 V -1 04/09/26, 11:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99842

  8. Stefan Bürk commented on patch set 3 04/09/26, 11:42

    StorageAdapterInterface.php:113 Reply

    Or not. The interface and implementation are `@internal`. Missed that.
  9. Stefan Bürk commented on patch set 4 V -1 04/09/26, 11:43

    Published edit on patch set 3.
  10. core-ci voted on patch set 4 V +1 04/09/26, 12:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99847

  11. Stefan Bürk updated the commit message in patch set 5 V +1 04/09/26, 12:45

  12. core-ci voted on patch set 5 V +1 04/09/26, 12:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99853

  13. Garvin Hicking updated the commit message in patch set 6 V +1 04/09/26, 16:24

  14. core-ci voted on patch set 6 V +1 04/09/26, 16:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99873

  15. Garvin Hicking commented on patch set 6 CR +1 V +1 04/09/26, 18:52

    Unresolved

    Thanks for noticing, and guilty as charged: I did my tests in the same browser, thus having a valid backend user login active. I'm really sorry that this slipped my review. Having said that: I already contacted Josua, we definitely need a frontend-based functional test to fixate the behavior, especially given we want to touch this in v15 again. I think we should be able to some something along the lines of https://review.typo3.org/c/Packages/TYPO3.CMS/+/90226: Setup a dummy site, fixture with tt_content form pi1 plugin, request the frontend URI as a subrequest, do assertions, submit a dummy YAML form (once loaded from deprecated filesystem, once loaded with the DB adapter), using a YAML that has a savetoDbFinisher enabled. Then assert that the submitted form contains the data and is persisted. Then test this once with a valid BE authentication, and once without. I don't mind creating that test independently from this bugfix, but it would make it better to review if we added the regression test case inside here.
  16. Georg Ringer voted on patch set 6 CR +2 V +2 04/09/26, 20:02

  17. Georg Ringer merged patch set 7 04/09/26, 20:02