89704[TASK] Use TCA Schema in Restriction Container
Commit message
Review
-
Code review CR +2 Done
- Oli Bartsch +2
- Benjamin Franzke +1
- Stefan Bürk +1
- Benni Mack +1
-
Verified V +2 Done
- Oli Bartsch +2
- Benjamin Franzke +1
- Stefan Bürk +1
- Benni Mack +1
- core-ci +1 CI
Issues 1
Files 32
- typo3/sysext/core/Classes/Database/Query/Restriction/DeletedRestriction.php6+16 −3
- typo3/sysext/core/Classes/Database/Query/Restriction/EmptyRestrictionContainer.phpnew+20 −0
- typo3/sysext/core/Classes/Database/Query/Restriction/EndTimeRestriction.php+12 −3
- typo3/sysext/core/Classes/Database/Query/Restriction/FrontendGroupRestriction.php+10 −3
- typo3/sysext/core/Classes/Database/Query/Restriction/HiddenRestriction.php+16 −3
- typo3/sysext/core/Classes/Database/Query/Restriction/StartTimeRestriction.php+12 −3
- typo3/sysext/core/Classes/Database/Query/Restriction/WorkspaceRestriction.php+6 −1
- typo3/sysext/core/Classes/Database/Connection.php+3 −1
- typo3/sysext/core/Classes/Database/ConnectionPool.php+8 −0
- typo3/sysext/core/Classes/ServiceProvider.php+5 −3
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/AbstractRestrictionContainerTest.phprenamed+21 −2
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/AbstractRestrictionTestCase.phprenamed+3 −3
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/DefaultRestrictionContainerTest.phpnew+66 −0
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/DeletedRestrictionTest.phprenamed+10 −4
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/DocumentTypeExclusionRestrictionTest.phprenamed+1 −1
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/EndTimeRestrictionTest.phpnew+80 −0
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/FrontendGroupRestrictionTest.phpnew+121 −0
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/FrontendRestrictionContainerTest.phprenamed+11 −3
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/HiddenRestrictionTest.phprenamed+17 −5
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/LimitToTablesRestrictionContainerTest.phprenamed+55 −8
Show 12 more files
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/PageIdListRestrictionTest.phprenamed+1 −1
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/PagePermissionRestrictionTest.phprenamed+1 −1
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/RootLevelRestrictionTest.phprenamed+1 −1
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/StartTimeRestrictionTest.phpnew+79 −0
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/WorkspaceRestrictionTest.php+43 −18
- typo3/sysext/core/Tests/Unit/Database/Query/Restriction/DefaultRestrictionContainerTest.phpdeleted+0 −43
- typo3/sysext/core/Tests/Unit/Database/Query/Restriction/EndTimeRestrictionTest.phpdeleted+0 −55
- typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendGroupRestrictionTest.phpdeleted+0 −78
- typo3/sysext/core/Tests/Unit/Database/Query/Restriction/StartTimeRestrictionTest.phpdeleted+0 −55
- typo3/sysext/core/Tests/Unit/Database/Query/QueryBuilderTest.php+184 −54
- typo3/sysext/core/Tests/Unit/Database/ConnectionTest.php+12 −0
- typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Storage/Typo3DbQueryParserTest.php+2 −2
Review log 2434
Show 69 earlier messages
-
Oli Bartsch uploaded patch set 1 06/11/25, 10:59
-
core-ci voted on patch set 1 V -1 06/11/25, 11:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80193
-
Mathias Brodala commented on patch set 1 06/11/25, 11:13
-
Oli Bartsch uploaded patch set 2
V -106/11/25, 14:56 -
Oli Bartsch commented on patch set 2 06/11/25, 14:59
DeletedRestriction.php:51ReplyAs best practice, has() should always be called instead of catching possible exceptions. Additionally, first operation in get() is to check with has() and throw the exception otherwise. So we are calling has() in any case. -
core-ci voted on patch set 2 V -1 06/11/25, 15:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80207
-
Mathias Brodala commented on patch set 2 06/11/25, 15:16
DeletedRestriction.php:51ReplyGeh, you are totally right. So calling has() explicitly is actually cheaper. 😄 -
Oli Bartsch uploaded patch set 3
V -106/26/25, 09:42 -
core-ci voted on patch set 3 V -1 06/26/25, 09:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80971
-
Oli Bartsch uploaded patch set 4
V -106/26/25, 10:54 -
core-ci voted on patch set 4 V -1 06/26/25, 11:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80973
-
Oli Bartsch uploaded patch set 5
V -106/26/25, 14:02 -
core-ci voted on patch set 5 V -1 06/26/25, 14:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80990
-
Benjamin Franzke uploaded patch set 6
V -106/26/25, 19:32 -
core-ci voted on patch set 6 V -1 06/26/25, 19:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81027
-
Oli Bartsch uploaded patch set 7
V -106/26/25, 20:20 -
core-ci voted on patch set 7 V +1 06/26/25, 20:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81034
-
Oli Bartsch uploaded patch set 8
V +106/26/25, 20:47 -
core-ci voted on patch set 8 V +1 06/26/25, 20:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81037
-
Benni Mack voted on patch set 8 CR +1 V +1 06/27/25, 09:23
-
Benjamin Franzke commented on patch set 8 CR -1 06/30/25, 07:51
DeletedRestriction.php:36I pushed this construct last week to make tests "green", I'm still -1ing for now, since I want to explore better alternatives. Hope that's ok. -
Benjamin Franzke commented on patch set 8 06/30/25, 09:59
DeletedRestriction.php:36ReplyTo make clear what I'm thinking about: We basically need to workaround our own legacy in here, which is the EXT:install SetupService that is using ConnectionPool without symfony dependency injection. We actually forbid this for extensions in v12 (deprecated in v11) with: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72558 But since we allowed ConnectionPool in installtool with the failsafe container we didn't notice that we break our own rules, in order to efficently introduce DI in our database layer. So what we'd probably need to achieve is: Use LateBootService wherever ConnectionPool is used in EXT:install. Otherwise we'll be stacking workarounds over workarounds.DeletedRecords.php:307As for FormEngine data providers we'd actually need mutable Schema (of course via immutability pattern, using object clones) here, that would allow a modified schema instance to be build, which then needs to be passable to Connection restrictions. Having to `rebuild()` the entire schema for temporary modifications does not scale in the long run… Given that in mind we more often need to think about passing `Schema` objects instead of tablename references around. -
Oli Bartsch commented on patch set 8 06/30/25, 11:02
DeletedRecords.php:307ReplyYes sure, this is already in the making for the "TCA Schema API in FormEngine" migration. -
Benjamin Franzke uploaded patch set 9
CR +1V +107/01/25, 12:00 -
Benjamin Franzke commented on patch set 9 07/01/25, 12:00
DeletedRestriction.php:36ReplyOk, so I tried to make this injectable, see https://review.typo3.org/c/Packages/TYPO3.CMS/+/89956/1/typo3/sysext/core/Classes/Database/Query/Restriction/DeletedRestriction.php …which involved introduction DI in the database layer, requires dozen of rewrites in the install tool by using late booted container in various services and controllers.. > 89956: [WIP][TASK] Require and use symfony DI in database related services | https://review.typo3.org/c/Packages/TYPO3.CMS/+/89956 I noticed that task is too large, but I don't want to block this change any longer, while I really want to avoid `GeneralUtility::getContainer()->has(`… Therefore I've now added a bridge that adds an empty restriction container (which is what we added implicitly to all restrictions with the nullable tca schema factory) in case the connection pool is "used" by the install tool setup tools and therefore the restrictions can now rely on a container being available. Still not super happy with it, but it should be better than before.DeletedRecords.php:307ReplyI understand, but that is quite far away and we haven't discussed the concrete details. I still think this code is kinda fishy – has been introduced with https://review.typo3.org/c/Packages/TYPO3.CMS/+/45292 – and I wonder if this can be replaced by better code. I do not understand why the db-querying methods that are tried to be "fixed" here, do not just remove the "DeletedRestriction" from the query. -
core-ci voted on patch set 9 V +1 07/01/25, 12:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81184
-
Benjamin Franzke commented on patch set 9 07/01/25, 12:26
DeletedRecords.php:307ReplyPossible solution: > 89960: [WIP][TASK] Avoid rebuild TCA schema in recycler DeletedRecords model | https://review.typo3.org/c/Packages/TYPO3.CMS/+/89960 -
Benjamin Franzke uploaded patch set 10
V +107/02/25, 06:18 -
Benjamin Franzke commented on patch set 10 CR +1 V +1 07/02/25, 06:19
DeletedRecords.php:307ReplyThis is actually a bug: https://forge.typo3.org/issues/93714 So let's fix this first, this patch is now in a relation chain to that bugfix: > https://review.typo3.org/c/Packages/TYPO3.CMS/+/89960/5?usp=related-change -
core-ci voted on patch set 10 V +1 07/02/25, 06:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81231
-
Benni Mack commented on patch set 10 CR +1 V +1 07/02/25, 09:41
Thanks for the rework! -
Stefan Bürk voted on patch set 10 CR +1 V +1 07/02/25, 09:49
-
Oli Bartsch voted on patch set 10 CR +2 V +2 07/02/25, 10:56
-
Oli Bartsch merged patch set 11 07/02/25, 10:56
DeletedRestriction.php:51