73519[BUGFIX] Check if vanillaUid is actually a real number
Commit message
Review
-
Code review CR +2 Done
- Georg Ringer +2
- Oli Bartsch +1
- Jochen Roth +1
- Stefan Bürk +1
-
Verified V +2 Done
- Georg Ringer +2
- Oli Bartsch +1
- Jochen Roth +1
- Stefan Bürk +1
- core-ci +1 CI
Issues 1
Files 2
Review log 2025
-
Georg Ringer uploaded patch set 1 02/15/22, 11:49
-
Georg Ringer commented on patch set 1 02/15/22, 11:49
This change is ready for review. -
core-ci voted on patch set 1 V -1 02/15/22, 12:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23616
-
Georg Ringer uploaded patch set 2 02/15/22, 12:29
-
core-ci voted on patch set 2 V +1 02/15/22, 12:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23619
-
Jochen Roth voted on patch set 2 V +1 CR +1 02/15/22, 12:42
-
Oliver Klee voted on patch set 2 CR +1 02/15/22, 12:46
-
Oli Bartsch commented on patch set 2 CR -1 02/15/22, 12:47
Let's add some tests for this scenario. Test class already exists. -
Georg Ringer uploaded patch set 3 02/15/22, 13:09
-
Oliver Klee voted on patch set 3 CR +1 02/15/22, 13:17
-
core-ci voted on patch set 3 V +1 02/15/22, 13:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23622
-
Jochen Roth voted on patch set 3 V +1 CR +1 02/15/22, 13:22
-
Oli Bartsch commented on patch set 3 02/15/22, 16:06
DatabaseParentPageRow.php:50AFAICS this is a PHP version related problem, see https://3v4l.org/nk10B and https://www.php.net/manual/de/language.types.numeric-strings.php. It should therefore be fine to just cast $result['vanillaUid'] manually to an integer, see https://3v4l.org/o7mK8, to restore the previous behaviour.DatabaseParentPageRowTest.php:177Not that important, but if you update the patch again, you might want to set 'databaseRow' to an empty array here, to mimic a real use case. -
Georg Ringer commented on patch set 3 02/16/22, 18:41
DatabaseParentPageRow.php:50Replytrue but this would hide the reason why we do it -
Oli Bartsch commented on patch set 3 02/16/22, 20:43
DatabaseParentPageRow.php:50ReplyActually all those conditions are odd. There is still the "$result['vanillaUid'] < 0" check which also may have side effects. Also the str_starts_with check only prevents one possibility. We're however still not sure whether $result['vanillaUid'] is an integer. This means, the actual bug (a TypeError) is not solved since we don't ensure that $result['vanillaUid'] is a valid integer. We now just ensure a string representation of the value does not start with "NEW". My suggestion was based on the assumption to just restore the previous behaviour. In case we want to even improve the code, I suggest to wrap the block e.g. into a MathUtility::canBeInterpretedAsInteger(), and to skip the block if it's not the case. Additionally, we could create a local variable, casted to int, which we then use for the < 0 and > 0 checks (Passing this to getRecordFromDatabase() is then also save). What do you think? I could do the necessary adjustments to the patch, if you like. -
Georg Ringer commented on patch set 3 02/16/22, 20:48
DatabaseParentPageRow.php:50ReplyPls go ahead;) -
Oli Bartsch uploaded patch set 4 02/16/22, 21:49
-
Oli Bartsch uploaded patch set 5 02/16/22, 21:50
-
core-ci voted on patch set 4 V +1 02/16/22, 21:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23757
-
core-ci voted on patch set 5 V +1 02/16/22, 22:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23759
-
Oli Bartsch commented on patch set 5 V +1 CR +1 02/16/22, 22:33
DatabaseParentPageRow.php:50ReplyDoneDatabaseParentPageRowTest.php:177ReplyDone -
Jochen Roth voted on patch set 5 V +1 CR +1 02/17/22, 12:03
-
Stefan Bürk voted on patch set 5 V +1 CR +1 02/18/22, 00:39
-
Georg Ringer voted on patch set 5 V +2 CR +2 02/18/22, 16:04
-
Georg Ringer merged patch set 6 02/18/22, 16:04