64623[BUGFIX] Fix unique slug when counter suffix fails
Commit message
Review
-
Code review CR +2 Done
- Anja Leichsenring +2
- Christian Kuhn +1
-
Verified V +2 Done
- Anja Leichsenring +2
- Christian Kuhn +1
- TYPO3com +1 CI
Issues 1
Files 3
Review log 2027
Show 12 earlier messages
-
filigivuji filigivuji uploaded patch set 1 05/30/20, 23:12
-
TYPO3com voted on patch set 1 V +1 05/30/20, 23:26 Completed build in 13m 31s on Sat, 30 May, 11:26 PM Test Summary: 73007 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3713
-
Andreas Kienast voted on patch set 1 CR +1 05/31/20, 07:18
-
Anja Leichsenring uploaded patch set 2 05/31/20, 13:48
-
TYPO3com voted on patch set 2 V +1 05/31/20, 14:02 Completed build in 14m 13s on Sun, 31 May, 02:02 PM Test Summary: 72907 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3720
-
filigivuji filigivuji commented on patch set 2 05/31/20, 14:32
-
Stefan P commented on patch set 2 07/24/20, 07:45
SlugHelper.php:391ReplyYes, you are right. I have this in a real setup where we happen to have (way) more than 100 pages with the same name. All over 100 get the same slug because of this. This is a major issue. This should be something like $rawValue . microtime() . rand() -
Christian Kuhn commented on patch set 2 CR -1 07/30/20, 20:00
If we add this additional param to the methods (which is then public api), we should have tests for what happens if it is set to 0 (expectation: an md5 suffix at first dubplicate match), and add exceptions if argument <0 (and test for the exception being thrown), and have an @param hint that reasonable low values should be set only (10.000.000 would create huge db load).SlugHelper.php:391Reply UnresolvedshordMD5(uniqid(mt_rand(), true)) should do (this is from getUniqId() of testing-framework BaseTestCase) -
Anja Leichsenring uploaded patch set 3 08/01/20, 09:47
-
TYPO3com voted on patch set 3 V -1 08/01/20, 09:58 Completed build in 11m 05s on Sat, 1 Aug, 09:58 AM Test Summary: 3 of 73498 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4346
-
Simon Gilli uploaded patch set 4 08/04/20, 20:17
-
TYPO3com voted on patch set 4 V +1 08/04/20, 20:30 Completed build in 12m 30s on Tue, 4 Aug, 08:30 PM Test Summary: 72966 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4413
-
Stefan P commented on patch set 4 08/05/20, 05:04
SlugHelper.php:432buildSlugForUniqueInTable and buildSlugForUniqueInPid are basically identical (only the while check differs). Both logics should be merged into one to have a common mechanism that does not have code duplication. -
Simon Gilli uploaded patch set 5 08/05/20, 10:22
-
Simon Gilli commented on patch set 5 08/05/20, 10:24
SlugHelper.php:432ReplyDone -
TYPO3com voted on patch set 5 V +1 08/05/20, 10:34 Completed build in 11m 14s on Wed, 5 Aug, 10:34 AM Test Summary: 72966 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4416
-
Anja Leichsenring voted on patch set 5 V +1 CR +1 08/12/20, 18:33
-
Benni Mack updated the commit message in patch set 6 08/13/20, 12:01
-
Benni Mack updated the commit message in patch set 7 08/13/20, 12:01
-
TYPO3com voted on patch set 6 V +1 08/13/20, 12:13 Completed build in 12m 18s on Thu, 13 Aug, 12:13 PM Test Summary: 72995 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4619
-
TYPO3com voted on patch set 7 V +1 08/13/20, 12:16 Completed build in 14m 30s on Thu, 13 Aug, 12:16 PM Test Summary: 72995 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4620
-
Christian Kuhn voted on patch set 7 V +1 CR +1 08/25/20, 17:19
-
Anja Leichsenring voted on patch set 7 V +2 CR +2 08/25/20, 17:20
-
Anja Leichsenring merged patch set 8 08/25/20, 17:20
-
Torben Hansen commented on patch set 8 02/03/21, 10:20
IMO this patch should also have been backported to TYPO3 9.5, since it contains a critical bugfix (see comment from Stefan). The function buildSlugForUniqueInSite will return a non unique slug, when the iteration has reached 100 resulting in duplicate slug entries in the database. -
Benni Mack commented on patch set 8 02/03/21, 11:44
I guess this is then related to https://forge.typo3.org/issues/92563 ? -
Torben Hansen commented on patch set 8 02/03/21, 11:52
Reply
Yes, it is. Problem starts at this line https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/core/Classes/DataHandling/SlugHelper.php#L404 All slugs generated after 100 iterations will get the same slug, because the shortMD5 will always return a non unique value.
SlugHelper.php:391