62974[BUGFIX] Prevent PHP type error and stale language cache
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Alexander Schnitzler +1
- Frank Nägler +1
-
Verified V +2 Done
- Benni Mack +2
- Alexander Schnitzler +1
- TYPO3com +1 CI
Issues 2
Files 1
Review log 1517
-
Andreas Kienast commented on patch set 1 01/21/20, 09:13
Cherry Picked from branch master. -
TYPO3com voted on patch set 1 V +1 01/21/20, 09:24 Completed build in 10m 48s on Tue, 21 Jan, 09:24 AM Test Summary: 73979 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-1898
-
Oliver Klee commented on patch set 1 01/21/20, 11:36
GridDataService.php:596According to the signature of getSystemLanguageValue, $pageId already is an integer. So either we need to change the @param annotation here to int|string (or int|null or whatever other type is passed), or we should move the type cast to the caller(s) instead. Otherwise, when this method here gets type annotations, we will get type errors again. What do you think? -
Andreas Kienast commented on patch set 1 01/21/20, 11:57
GridDataService.php:596ReplyWe can do that, but not in this patch please since it's just a backport. -
Oliver Klee voted on patch set 1 CR +1 01/21/20, 12:14
-
Benni Mack commented on patch set 1 01/31/20, 17:00
GridDataService.php:596ReplyI think for the backport this is fine, we had a similar issue recently around that area where "" depending on the RDBMs did not show anything in the workspaces module because of that. -
Oliver Hader commented on patch set 1 CR -1 02/02/20, 08:59
GridDataService.php:618UnresolvedThat leads to fetching sys_language records for each workspace record that is not contained in a page-branch that has a Site configuration (which is different to the v10 behavior). Instead local cache could be extended to contain $pageId partition which has been introduced first in https://review.typo3.org/c/Packages/TYPO3.CMS/+/61571 (9.5). e.g. $this->systemLanguages[$pageId] = ... -
Benni Mack commented on patch set 1 04/30/20, 07:40
I'll abandon this change now - there hasn't been any movement in the last months on this topic, and no votes. And it works in TYPO3 v10. If somebody finds people working on that, this change can be restored later-on. -
Benni Mack abandoned the change 04/30/20, 07:40
no movement -
Benni Mack restored the change 05/05/20, 13:49
-
Benni Mack updated the commit message in patch set 2 05/05/20, 13:50
-
TYPO3com voted on patch set 2 V +1 05/05/20, 14:02 Completed build in 11m 56s on Tue, 5 May, 02:02 PM Test Summary: 74834 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-566
-
Benni Mack voted on patch set 2 CR +1 05/05/20, 14:59
-
Frank Nägler voted on patch set 2 CR +1 05/11/20, 07:11
-
Alexander Schnitzler commented on patch set 2 V +1 CR +1 05/13/20, 17:30
GridDataService.php:596Reply UnresolvedSince I am working on type safety via phpstan as well at the moment I'd like to say that I would not change the method signature to a union type because of two reasons: - Accepting anything other than int does not make sense here as we need $pageId to be an int as soon as it is passed into getSystemLanguages - Widening the types makes it hard to have a type safe method unless version 11.0 will have PHP 8.0 as minimum dependency (which allows native union types) I think the solution chosen here is exactly right. phpstan will tell me if the doc block is actually safe or not and I will create a patch accordingly. And as soon as we are able to automatically add type declarations we can also automatically remove superfluous castings. -
Benni Mack voted on patch set 2 V +2 CR +2 05/14/20, 07:29
-
Benni Mack merged patch set 3 05/14/20, 07:29