81945[FEATURE] Introduce ErrorHandler for 403 errors with redirect option
Commit message
Review
-
Code review CR +2 Done
- Georg Ringer +2
- Garvin Hicking +1
- Markus Klein +1
-
Verified V +2 Done
- Georg Ringer +2
- Garvin Hicking +1
- core-ci +1 CI
Issues 1
Files 5
- typo3/sysext/backend/Configuration/SiteConfiguration/site_errorhandling.php5+25 −0
- typo3/sysext/backend/Resources/Private/Language/locallang_siteconfiguration_tca.xlf+15 −0
- typo3/sysext/core/Classes/Error/PageErrorHandler/RedirectLoginErrorHandler.php6new+140 −0
- typo3/sysext/core/Classes/Site/Entity/Site.php+4 −0
- typo3/sysext/core/Documentation/Changelog/13.3/Feature-101252-IntroduceErrorHandlerFor403ErrorsWithRedirectOption.rstnew+60 −0
Review log 4257
Show 2132 earlier messages
-
Torben Hansen uploaded patch set 1 11/23/23, 21:18
-
core-ci voted on patch set 1 V -1 11/23/23, 21:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49823
-
Torben Hansen uploaded patch set 2
V -111/24/23, 07:46 -
core-ci voted on patch set 2 V -1 11/24/23, 07:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49832
-
Torben Hansen uploaded patch set 3
V -111/24/23, 08:12 -
core-ci voted on patch set 3 V +1 11/24/23, 08:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49834
-
Torben Hansen rebased onto patch set 4
V +105/11/24, 10:10 -
core-ci voted on patch set 4 V +1 05/11/24, 10:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57516
-
Torben Hansen uploaded patch set 5
V +105/11/24, 17:16 -
Torben Hansen updated the commit message in patch set 6 05/11/24, 17:17
-
core-ci voted on patch set 5 V +1 05/11/24, 17:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57520
-
core-ci voted on patch set 6 V +1 05/11/24, 17:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57521
-
Mathias Brodala commented on patch set 6 05/13/24, 09:22
-
Torben Hansen uploaded patch set 7
V +105/13/24, 12:52 -
Torben Hansen commented on patch set 6 05/13/24, 12:52
Feature-101252-IntroduceErrorHandlerFor403ErrorsWithRedirectOptionToExtfelogin.rst:14ReplyDone -
core-ci voted on patch set 7 V +1 05/13/24, 12:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57621
-
Garvin Hicking uploaded patch set 8
V +106/14/24, 07:34Minor spelling -
Garvin Hicking commented on patch set 8 06/14/24, 07:35
Feature-101252-IntroduceErrorHandlerFor403ErrorsWithRedirectOptionToExtfelogin.rst:14ReplyCould you maybe more specifically write where/how this `loginRedirectPid` parameter would be set? It's attributed with ":php:" but I kind of believe this is a TypoScript parameter? Maybe having an example configuration/implementation code would clear this up...? -
Torben Hansen commented on patch set 8 06/14/24, 07:39
Feature-101252-IntroduceErrorHandlerFor403ErrorsWithRedirectOptionToExtfelogin.rst:14ReplyThe `loginRedirectPid` is configured in site settings, when the error handler is setup. Should I completely avoid using `loginRedirectPid` and just write "the configured page"? -
core-ci voted on patch set 8 V +1 06/14/24, 07:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59575
-
Garvin Hicking commented on patch set 8 06/14/24, 10:31
Feature-101252-IntroduceErrorHandlerFor403ErrorsWithRedirectOptionToExtfelogin.rst:14ReplyAh, I see. Maybe then: When active, the :php:`RedirectLoginErrorHandler` redirects the user to the configured page (Site Settings, :php:`loginRedirectPid`) in case of a 403 error. -
Torben Hansen uploaded patch set 9
V +106/15/24, 12:26 -
core-ci voted on patch set 9 V +1 06/15/24, 12:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59643
-
Torben Hansen commented on patch set 9 06/16/24, 04:34
Feature-101252-IntroduceErrorHandlerFor403ErrorsWithRedirectOptionToExtfelogin.rst:14ReplyDone -
Torben Hansen uploaded patch set 10
V +107/07/24, 05:22 -
core-ci voted on patch set 10 V +1 07/07/24, 05:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61132
-
Georg Ringer voted on patch set 10 CR +1 V +1 07/07/24, 19:17
-
Markus Klein commented on patch set 10 07/08/24, 10:25
RedirectLoginErrorHandler.php:33I would rephrase to: ", where the ext:felogin plugin (or some other plugin handling the 'redirect_url`) ..."RedirectLoginErrorHandler.php:50that's not necessarily a pid here, it can by any valid TS syntax. so maybe `loginRedirectPid` is actually misleading -
Torben Hansen uploaded patch set 11
CR +1V +107/08/24, 14:22 -
Torben Hansen commented on patch set 10 07/08/24, 14:22
RedirectLoginErrorHandler.php:33ReplyOK for me to change this here. But we also refer to ext:felogin in other places (e.g. error handler name), where this rephrasing does not fit UI-wise.RedirectLoginErrorHandler.php:50ReplyChanged to configuration name to `loginRedirectTarget`. The `loginRedirectPid` property is kept, since it is ensured this is always an page uid (int). -
core-ci voted on patch set 11 V +1 07/08/24, 14:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61176
-
Christian Kuhn commented on patch set 11 07/08/24, 14:42
site_errorhandling.php:15are we sure this should be part of ext core/backend? it's kinda tailored for felogin, maybe felogin should shit it, or do you think that's not a good idea?
-
Torben Hansen commented on patch set 11 07/08/24, 16:10
site_errorhandling.php:15ReplyThought about that too, but then you have to register the error handler as PHP Error handler (errorPhpClassFQCN configuration), where the user manually has to provide the error handler FQDN. Since this is not really user friendly, I decided against that integration. Maybe we could somehow extend `Site` object to support a more dynamic/user friendly custom error handling registration, but I currently have no idea how this could be archived. -
Markus Klein commented on patch set 11 07/09/24, 06:39
site_errorhandling.php:15ReplyIt's not really tailored for felogin. Consider ext:oidc. It's handling the redirect_url as well. And meanwhile we install ext:oidc nearly as often as felogin -
Torben Hansen commented on patch set 11 07/09/24, 11:09
site_errorhandling.php:15ReplySo maybe we should rephrase all occurencees of "felogin" with something like you originally suggested (e.g. "a plugin which handles `return_url` GET parameter")? The error handler actually uses `return_url`, since this is evaluated before `redirect_url`) -
Torben Hansen uploaded patch set 12
V +108/06/24, 05:59 -
Torben Hansen commented on patch set 12 08/06/24, 06:03
site_errorhandling.php:15ReplyChanged the scope of this patch to not only ext:felogin, but to a general and configurable GET parameter (`return_url` and `redirect_url`). This can be used by 3rd party extensions to implement a custom login redirection process. Added to RST file, that ext:felogin and ext:oidc both support the configurable URL parameter. -
core-ci voted on patch set 12 V +1 08/06/24, 06:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62874
-
Garvin Hicking uploaded patch set 13
V +108/21/24, 11:04ReST update -
Garvin Hicking commented on patch set 13 CR +1 V +1 08/21/24, 11:06
I just tested this and it works quite nicely, and would remove a lot of problematic custom ErrorHandler implementations I've seen in "the wild", or even more problematic, custom middlewares doing the redirects with a lot of extra mileage. (BTW: The ErrorHandler itself also works nicely in v11 and v12, we also tested it in a v11 instance) -
core-ci voted on patch set 13 V -1 08/21/24, 11:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63897
-
Sandra Erbel commented on patch set 13 V +1 08/21/24, 11:28
Garvin and me tested it in a v11.5 instance. But we used the RedirectLoginErrorHandler class not in terms of a `LoginRedirect` errorHandler but in terms of a custom `PHP` errorHandler in the error handling. We had to hard code the login pid, where to redirect, into the constructor: `$configuration = ['loginRedirectTarget' => 't3://page?uid=656', 'loginRedirectParameter' => 'return_url'];`. It was not possible to use settings.yaml (introduced with v12.1) in order to get the parameters from the site settings. As redirect mode we used `getpost`. We could omit all config settings like for example `typolinkLinkAccessRestrictedPages = ...`. But all in all it works fine. After a successful fe-login in the incognito window we were guided to the page we initially tried to get access to. -
Garvin Hicking commented on patch set 14
CR +1V +108/21/24, 12:38Published edit on patch set 13. -
Garvin Hicking voted on patch set 14 CR +1 V +1 08/21/24, 12:38
-
Sandra Erbel commented on patch set 14 08/21/24, 12:44
Thanks for correcting the small typo. -
Sandra Erbel voted on patch set 14 V +1 08/21/24, 12:45
-
core-ci voted on patch set 14 V +1 08/21/24, 12:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63908
-
Garvin Hicking commented on patch set 14 08/29/24, 14:30
In the documentation patch for this (https://review.typo3.org/c/Packages/TYPO3.CMS/+/85817) the code review suggested to use final class here, and private properties, what do you think? -
Torben Hansen commented on patch set 14 08/29/24, 15:01
Reply
All other core PageErrorHandlers use protected properties and are not final. IMO we should not mix implementations (some classes of same implementation final and others not) and use the existing (non-final and protected properties). If this is really a topic for discussion, I suggest to contact a core merger to make a dicision on if we should make all PageErrorHandlers final and use private properties. I however think this is a breaking change and then something for v14. -
Garvin Hicking commented on patch set 14 08/29/24, 16:04
Reply
IMO your reasoning sounds good. I think for a custom code enhancement in the doc patch we could divert from that. To re-rail this: This patch still works well for the cases I tested. -
Markus Klein commented on patch set 14 09/03/24, 11:11
RedirectLoginErrorHandler.php:42unused -
Markus Klein uploaded patch set 15
CR +1V +109/03/24, 11:13 -
Markus Klein commented on patch set 15 CR +1 09/03/24, 11:14
RedirectLoginErrorHandler.php:42ReplyDone -
core-ci voted on patch set 15 V +1 09/03/24, 11:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64660
-
Garvin Hicking voted on patch set 15 CR +1 V +1 09/03/24, 12:20
-
Georg Ringer voted on patch set 15 CR +2 V +2 09/04/24, 11:56
-
Georg Ringer merged patch set 16 09/04/24, 11:56
Feature-101252-IntroduceErrorHandlerFor403ErrorsWithRedirectOptionToExtfelogin.rst:14