60781[FEATURE] Add restriction container that limits applicable tables
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Markus Klein +1
- Manuel Selbach +1
- Andreas Kienast +1
-
Verified V +2 Done
- Benni Mack +2
- Manuel Selbach +1
- TYPO3com +1 CI
Issues 1
Files 5
- typo3/sysext/core/Classes/Database/Query/Restriction/LimitToTablesRestrictionContainer.phpnew+115 −0
- typo3/sysext/core/Classes/Database/Query/QueryBuilder.php4+11 −0
- typo3/sysext/core/Documentation/Changelog/master/Feature-87776-LimitRestrictionToTablesInQueryBuilder.rst5new+71 −0
- typo3/sysext/core/Tests/Unit/Database/Query/Restriction/LimitToTablesRestrictionContainerTest.phpnew+95 −0
- typo3/sysext/core/Tests/Unit/Database/Query/QueryBuilderTest.php+101 −0
Review log 4877
Show 2852 earlier messages
-
Helmut Hummel uploaded patch set 1 05/20/19, 12:38
-
Helmut Hummel uploaded patch set 2 05/20/19, 12:41
-
Mathias Brodala commented on patch set 2 05/20/19, 12:43
-
TYPO3com voted on patch set 1 V -1 05/20/19, 12:44 Completed build in 06m 38s on Mon, 20 May, 02:44 PM Test Summary: 7331 of 46775 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33936
-
Helmut Hummel commented on patch set 1 05/20/19, 12:54
Feature-87776-LimitRestrictionToTablesInQueryBuilder.rst:24ReplyI thought about that. This would mean that we need to extend the interface of the container with this method. This would mean that implementers of containers would need to implement this behavior as well (or inherit it from the abstract), even if they don't need this behavior. Therefore I decided against this approach. With the suggestion here, we have a dedicated class for a dedicated behavior. It is pluggable where needed, and does not interfere with other behavior. I personally find this quite elegant. -
TYPO3com voted on patch set 2 V +1 05/20/19, 12:54 Completed build in 12m 29s on Mon, 20 May, 02:54 PM Test Summary: 46513 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33937
-
Helmut Hummel uploaded patch set 3 05/20/19, 12:57
-
Mathias Brodala commented on patch set 3 05/20/19, 12:59
Feature-87776-LimitRestrictionToTablesInQueryBuilder.rst:24ReplyYes, sounds good. :-) -
Nicole Hummel voted on patch set 3 CR +1 05/20/19, 13:02
-
TYPO3com voted on patch set 3 V +1 05/20/19, 13:09 Completed build in 11m 56s on Mon, 20 May, 03:09 PM Test Summary: 46513 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33938
-
Helmut Hummel commented on patch set 1 05/20/19, 13:24
Feature-87776-LimitRestrictionToTablesInQueryBuilder.rst:24ReplyBut of course it is a matter of deciding whether this behavior applies to 90% of the use cases or only 10%. If we decide now (or at some point in the future) that it is useful for 90% of the use cases, we should add a dedicated method for that in the interface for every container. -
Helmut Hummel uploaded patch set 4 05/20/19, 14:08
-
Helmut Hummel commented on patch set 4 05/20/19, 14:09
Patch set 4 adds (optional) usage examples in the FileSearchQuery class -
TYPO3com voted on patch set 4 V -1 05/20/19, 14:24 Completed build in 15m 51s on Mon, 20 May, 04:24 PM Test Summary: 18 of 46852 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33940
-
Manuel Selbach wrote 05/21/19, 13:02
Topic set to persistence -
Alexander Schnitzler commented on patch set 4 05/26/19, 11:10
First of all: Good thing to have this in the core. Applying all restrictions to all tables involved in a query is sometimes a bit annoying. I agree with your implementation but would also opt for adding one or two methods to the QueryRestrictionInterface. Methods like 'enableFor($aliases)' and/or 'disableFor($aliases)'. By adding another method 'getRestrictionByType' on the $queryBuilder, one could have a very nice and short api like: $queryBuilder->getRestrictionByType(HiddenRestriction::class)->disableFor('arbitraryJoinTable'). Just an idea, though... -
Manuel Selbach uploaded patch set 5 07/02/19, 16:30
-
TYPO3com voted on patch set 5 V +1 07/02/19, 16:40 Completed build in 10m 18s on Tue, 2 Jul, 06:40 PM Test Summary: 46848 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-34715
-
Manuel Selbach updated the commit message in patch set 6 07/16/19, 15:39
-
Manuel Selbach commented on patch set 6 07/16/19, 15:46
> Patch Set 4: > > First of all: Good thing to have this in the core. Applying all restrictions to all tables involved in a query is sometimes a bit annoying. > > I agree with your implementation but would also opt for adding one or two methods to the QueryRestrictionInterface. Methods like 'enableFor($aliases)' and/or 'disableFor($aliases)'. > > By adding another method 'getRestrictionByType' on the $queryBuilder, one could have a very nice and short api like: $queryBuilder->getRestrictionByType(HiddenRestriction::class)->disableFor('arbitraryJoinTable'). > > Just an idea, though... Thanks for your suggestion. Helmut and I discussed on the topic to add another method in detail a while ago. We decided not to do so, as this will have to be added to the interface and to be implemented at every place even for QueryRestictionContainerInterface as this is inherited from QueryRestritionInterface. This does not mean, it will not be able to add it in the future if the need raises. -
TYPO3com voted on patch set 6 V +1 07/16/19, 15:49 Completed build in 09m 38s on Tue, 16 Jul, 05:49 PM Test Summary: 47126 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35104
-
Manuel Selbach uploaded patch set 7 02/20/20, 09:35
-
TYPO3com voted on patch set 7 V -1 02/20/20, 10:18 Completed build in 02m 18s on Thu, 20 Feb, 10:18 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-336
-
Tymoteusz Motylewski uploaded patch set 8 02/24/20, 15:48
-
TYPO3com voted on patch set 8 V +1 02/24/20, 16:02 Completed build in 14m 02s on Mon, 24 Feb, 04:02 PM Test Summary: 71661 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-635
-
Tymoteusz Motylewski commented on patch set 8 02/25/20, 07:11
QueryRestrictionContainerInterface.php:46UnresolvedThis is a breaking change. We can make it non breaking for v10 by not changing the interface (and introducing the additional param in classes only) and then for v11 do the interface change. -
Manuel Selbach uploaded patch set 9 03/30/20, 20:46
-
TYPO3com voted on patch set 9 V -1 03/30/20, 20:59 Completed build in 13m 04s on Mon, 30 Mar, 08:59 PM Test Summary: 6432 of 73468 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1989
-
Manuel Selbach uploaded patch set 10 03/30/20, 21:09
-
TYPO3com voted on patch set 10 V -1 03/30/20, 21:25 Completed build in 16m 00s on Mon, 30 Mar, 09:25 PM Test Summary: 29 of 73237 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1990
-
TYPO3com commented on patch set 10 03/30/20, 21:44 Completed build in 11m 42s on Mon, 30 Mar, 09:44 PM Test Summary: 25 of 63207 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1992
-
TYPO3com commented on patch set 10 03/31/20, 07:25 Completed build in 21m 39s on Tue, 31 Mar, 07:25 AM Test Summary: 24 of 73546 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2006
-
Manuel Selbach uploaded patch set 11 03/31/20, 08:53
-
TYPO3com voted on patch set 11 V -1 03/31/20, 09:10 Completed build in 16m 18s on Tue, 31 Mar, 09:10 AM Test Summary: 24 of 73549 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2012
-
TYPO3com commented on patch set 11 03/31/20, 12:16 Completed build in 19m 23s on Tue, 31 Mar, 12:16 PM Test Summary: 38 of 73549 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2023
-
TYPO3com voted on patch set 11 V +1 03/31/20, 17:14 Completed build in 5h 35m 53s on Tue, 31 Mar, 05:13 PM Test Summary: 73062 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2023
-
TYPO3com commented on patch set 11 03/31/20, 17:35 Completed build in 8h 57m 04s on Tue, 31 Mar, 05:35 PM Test Summary: 73062 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2012
-
Manuel Selbach uploaded patch set 12 03/31/20, 20:02
-
TYPO3com voted on patch set 12 V -1 03/31/20, 20:23 Completed build in 20m 17s on Tue, 31 Mar, 08:23 PM Test Summary: 72769 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2034
-
TYPO3com commented on patch set 12 03/31/20, 20:42 Completed build in 18m 11s on Tue, 31 Mar, 08:42 PM Test Summary: 13 of 73254 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2035
-
TYPO3com commented on patch set 12 03/31/20, 20:53 Completed build in 13m 32s on Tue, 31 Mar, 08:53 PM Test Summary: 6 of 73255 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2036
-
TYPO3com commented on patch set 12 03/31/20, 21:00 Completed build in 14m 54s on Tue, 31 Mar, 09:00 PM Test Summary: 1 of 73042 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2037
-
TYPO3com commented on patch set 12 04/01/20, 07:52 Completed build in 11h 22m 00s on Wed, 1 Apr, 07:52 AM Test Summary: 2 of 73564 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2037
-
TYPO3com voted on patch set 12 V +1 04/01/20, 20:06 Completed build in 11m 18s on Wed, 1 Apr, 08:06 PM Test Summary: 73080 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2068
-
Benni Mack voted on patch set 12 CR +1 04/13/20, 10:24
-
Manuel Selbach uploaded patch set 13 04/13/20, 19:44
-
TYPO3com voted on patch set 13 V -1 04/13/20, 19:45 Completed build in 22s on Mon, 13 Apr, 07:45 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2458
-
Manuel Selbach uploaded patch set 14 04/13/20, 19:50
-
TYPO3com voted on patch set 14 V +1 04/13/20, 20:01 Completed build in 10m 52s on Mon, 13 Apr, 08:01 PM Test Summary: 73469 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2459
-
Benni Mack commented on patch set 14 04/14/20, 14:52
As this is a conceptual issue since TYPO3 v8 which was possible with TYPO3_DB before, I consider this adding to TYPO3 v10 LTS (if merged by Friday, 17th April 2020), so please review this patch. -
Georg Großberger commented on patch set 14 CR +1 04/15/20, 07:53
AbstractRestrictionContainer.php:86UnresolvedJust a micro optimization: "$key = $alias ?? get_class($restriction);" -
Manuel Selbach rebased onto patch set 15 04/15/20, 08:31
-
Manuel Selbach uploaded patch set 16 04/15/20, 08:33
-
TYPO3com voted on patch set 15 V -1 04/15/20, 08:39 Completed build in 34s on Wed, 15 Apr, 08:39 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2559
-
TYPO3com voted on patch set 16 V -1 04/15/20, 08:40 Completed build in 50s on Wed, 15 Apr, 08:40 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2560
-
Manuel Selbach uploaded patch set 17 04/15/20, 08:46
-
TYPO3com voted on patch set 17 V +1 04/15/20, 08:59 Completed build in 12m 14s on Wed, 15 Apr, 08:59 AM Test Summary: 73553 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2561
-
Georg Ringer voted on patch set 17 CR +1 04/15/20, 10:17
-
Frank Nägler voted on patch set 17 CR +1 04/15/20, 19:02
-
Helmut Hummel commented on patch set 17 04/16/20, 09:03
I know it was more or less my idea to do it this way. However this has one major downside and that is, that only ONE table based restriction can be added to a query, because restrictions are unique by class name -
Markus Klein commented on patch set 17 04/16/20, 18:03
Feature-87776-LimitRestrictionToTablesInQueryBuilder.rst:78UnresolvedI think this is wrong third person. Restriction container that implement ... need to be updated ... -
Helmut Hummel commented on patch set 17 04/17/20, 06:59
Looks mostly good for me. I‘d nevertheless limit this change to the bare minimum before getting it inReply
Ah solved with optional alias. Nice.QueryBuilder.php:1160UnresolvedCan you explain what this change is exactly for? (maybe I missed it in the discussion)AbstractRestrictionContainer.php:86Unresolvedshouldn’t we adapt the interface then as well?FileSearchQuery.php:136Unresolvednot sure whether it helps to use it here. but it would simplify this change if we could discuss this separately and remove this here.FileSearchQuery.php:202Unresolvedthis in fact is breaking in might reduce flexibility of the search demand -
Georg Großberger voted on patch set 17 V +1 CR +1 04/17/20, 11:29
-
Helmut Hummel commented on patch set 17 CR -2 04/17/20, 12:49
Working on a more straightforward solution -
Helmut Hummel uploaded patch set 18 04/17/20, 14:09
-
Helmut Hummel voted on patch set 18 CR 0 04/17/20, 14:10
-
Markus Klein commented on patch set 18 04/17/20, 14:29
QueryBuilder.php:94is this really needed? The container implements the Interface -
TYPO3com voted on patch set 18 V +1 04/17/20, 14:37 Completed build in 24m 32s on Fri, 17 Apr, 02:37 PM Test Summary: 73609 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2734
-
Helmut Hummel commented on patch set 18 04/17/20, 15:28
QueryBuilder.php:94ReplyIt is convenience so you can do the following: ``` $queryBuilder->getRestrictions()->limitRestrictionsToTables(['c2']); $queryBuilder->getRestrictions()->addForTables(...); ``` maybe it is better anyway to do: ``` $queryBuilder->getRestrictions()->limitRestrictionsToTables(['c2']); $restrictions = $queryBuilder->getRestrictions(); if ($restrictions intanceof LimitToTablesRestrictionContainer) { $queryBuilder->getRestrictions()->addForTables(...); } ``` hm, yeah. instance of is. better. I'll remove this -
Helmut Hummel commented on patch set 18 04/17/20, 15:28
QueryBuilder.php:94ReplyDone -
Helmut Hummel uploaded patch set 19 04/17/20, 15:29
-
Manuel Selbach voted on patch set 19 V +1 CR +1 04/17/20, 15:31
-
TYPO3com voted on patch set 19 V +1 04/17/20, 15:42 Completed build in 12m 35s on Fri, 17 Apr, 03:42 PM Test Summary: 73608 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2743
-
Markus Klein voted on patch set 19 CR +1 04/17/20, 15:42
-
Andreas Kienast voted on patch set 19 CR +1 04/17/20, 18:11
-
Benni Mack voted on patch set 19 V +2 CR +2 04/17/20, 18:23
-
Benni Mack merged patch set 20 04/17/20, 18:23
Feature-87776-LimitRestrictionToTablesInQueryBuilder.rst:24