Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.
74781[FEATURE] Introduce new slug builders for records and string
Commit message
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 59
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/81/74781/59 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/81/74781/59 && git cherry-pick FETCH_HEAD
Review
-
Code review CR -2 Blocked
- Stefan Bürk -2
- Christian Kuhn -1
-
Verified V 0 Needs a vote
- core-ci +1 CI
Issues 1
Files 30
- typo3/sysext/backend/Classes/Controller/FormSlugAjaxController.php+41 −56
- typo3/sysext/backend/Classes/Utility/BackendUtility.php+21 −0
- typo3/sysext/backend/Tests/Functional/Controller/FormSlugAjaxControllerTest.phpnew+413 −0
- typo3/sysext/core/Classes/DataHandling/DataHandler.php+80 −33
- typo3/sysext/core/Classes/DataHandling/SlugHelper.php5+24 −0
- typo3/sysext/core/Classes/Slug/Exception/InvalidSlugStringInputException.phpnew+20 −0
- typo3/sysext/core/Classes/Slug/Exception/RootPageOfExcludedTypeException.phpnew+20 −0
- typo3/sysext/core/Classes/Slug/Exception/SlugException.phpnew+20 −0
- typo3/sysext/core/Classes/Slug/RecordSlugBuilder.phpnew+447 −0
- typo3/sysext/core/Classes/Slug/RecordSlugUniqueChecker.phpnew+540 −0
- typo3/sysext/core/Classes/Slug/StringSlugBuilder.phpnew+197 −0
- typo3/sysext/core/Configuration/TCA/pages.php+1 −0
- typo3/sysext/core/Documentation/Changelog/13.1/Deprecation-95722-DeprecateSlugHelper.rstnew+46 −0
- typo3/sysext/core/Documentation/Changelog/13.1/Feature-95722-NewSlugBuildersAndUniqueChecker.rstnew+174 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Regular/MultiSite/MultiSiteTest.php+9 −0
- typo3/sysext/core/Tests/Functional/SiteHandling/SiteBasedTestTrait.php+1 −0
- typo3/sysext/core/Tests/Functional/Slug/RecordSlugBuilderTest.phpnew+766 −0
- typo3/sysext/core/Tests/Functional/Slug/RecordSlugUniqueCheckerTest.phpnew+285 −0
- typo3/sysext/core/Tests/Functional/Slug/StringSlugBuilderTest.phpnew+233 −0
- typo3/sysext/core/Tests/FunctionalDeprecated/DataHandling/Slug/DataSet/Pages.csvrenamed+0 −0
Show 10 more files
- typo3/sysext/core/Tests/FunctionalDeprecated/DataHandling/Slug/DataSet/PagesForSlugsUnique.csvrenamed+0 −0
- typo3/sysext/core/Tests/FunctionalDeprecated/DataHandling/Slug/DataSet/TestSlugUniqueWithLanguages.csvrenamed+0 −0
- typo3/sysext/core/Tests/FunctionalDeprecated/DataHandling/Slug/DataSet/TestSlugUniqueWithLanguagesResult.csvrenamed+0 −0
- typo3/sysext/core/Tests/FunctionalDeprecated/DataHandling/Slug/SlugHelperTest.phprenamed+2 −2
- typo3/sysext/core/Tests/FunctionalDeprecated/DataHandling/Slug/SlugHelperUniqueTest.phprenamed+2 −2
- typo3/sysext/core/Tests/FunctionalDeprecated/DataHandling/Slug/SlugHelperUniqueWithLanguageTest.phprenamed+2 −2
- typo3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php+16 −1
- typo3/sysext/core/Tests/UnitDeprecated/DataHandling/SlugHelperTest.phprenamed+1 −1
- typo3/sysext/redirects/Classes/Service/SlugService.php+8 −8
- typo3/sysext/redirects/Tests/Functional/Service/SlugServiceTest.php+2 −0
Review log 96156
Show 76131 earlier messages
-
Rozbeh Chiryai Sharahi uploaded patch set 1 05/28/22, 14:17
-
core-ci voted on patch set 1 V -1 05/28/22, 14:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27516
-
Rozbeh Chiryai Sharahi uploaded patch set 2 05/28/22, 14:47
-
core-ci voted on patch set 2 V -1 05/28/22, 14:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27518
-
Rozbeh Chiryai Sharahi uploaded patch set 3 05/28/22, 14:56
-
core-ci voted on patch set 3 V +1 05/28/22, 15:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27519
-
Rozbeh Chiryai Sharahi uploaded patch set 4 05/28/22, 15:28
-
core-ci voted on patch set 4 V -1 05/28/22, 15:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27520
-
Rozbeh Chiryai Sharahi uploaded patch set 5 05/28/22, 17:36
-
core-ci voted on patch set 5 V +1 05/28/22, 17:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27522
-
Rozbeh Chiryai Sharahi uploaded patch set 6 05/28/22, 21:30
-
core-ci voted on patch set 6 V +1 05/28/22, 21:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27531
-
Rozbeh Chiryai Sharahi uploaded patch set 7 05/29/22, 13:32
-
core-ci voted on patch set 7 V +1 05/29/22, 13:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27550
-
Rozbeh Chiryai Sharahi uploaded patch set 8 05/29/22, 22:09
-
core-ci voted on patch set 8 V -1 05/29/22, 22:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27565
-
Rozbeh Chiryai Sharahi uploaded patch set 9 05/29/22, 22:31
-
core-ci voted on patch set 9 V +1 05/29/22, 22:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27566
-
Rozbeh Chiryai Sharahi uploaded patch set 10 05/31/22, 11:41
-
core-ci voted on patch set 10 V -1 05/31/22, 11:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27599
-
Rozbeh Chiryai Sharahi uploaded patch set 11 05/31/22, 21:09
-
core-ci voted on patch set 11 V +1 05/31/22, 21:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27608
-
Rozbeh Chiryai Sharahi uploaded patch set 12 06/02/22, 23:33
-
core-ci voted on patch set 12 V -1 06/02/22, 23:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27663
-
Rozbeh Chiryai Sharahi uploaded patch set 13 06/03/22, 18:08
-
core-ci voted on patch set 13 V -1 06/03/22, 18:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27693
-
Rozbeh Chiryai Sharahi uploaded patch set 14 06/05/22, 00:17
-
Rozbeh Chiryai Sharahi uploaded patch set 15 06/05/22, 00:23
-
core-ci voted on patch set 14 V -1 06/05/22, 00:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27702
-
core-ci voted on patch set 15 V -1 06/05/22, 00:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27703
-
Rozbeh Chiryai Sharahi uploaded patch set 16 06/10/22, 21:50
-
core-ci voted on patch set 16 V -1 06/10/22, 21:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27956
-
Rozbeh Chiryai Sharahi uploaded patch set 17 06/10/22, 22:33
-
core-ci voted on patch set 17 V +1 06/10/22, 22:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27959
-
Rozbeh Chiryai Sharahi uploaded patch set 18 06/15/22, 07:59
-
core-ci voted on patch set 18 V +1 06/15/22, 08:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28091
-
Simon Schaufelberger commented on patch set 18 06/23/22, 16:09
Hello Rozbeh, do you want to finish your slug builder? That would be grea! -
Rozbeh Chiryai Sharahi uploaded patch set 19 06/23/22, 19:13
-
core-ci voted on patch set 19 V +1 06/23/22, 19:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28362
-
Rozbeh Chiryai Sharahi commented on patch set 19 06/23/22, 19:31
This change is ready for review.Reply
Hey Simon, definitely. I am continuously working on it but still three big tasks open: 1) Workspace integration (specially tests) 2) Documentation update 3) Eventual refactorings, after all tests are implemented 4) ... maybe more I surely underestimated the amount of little details to be considered on typo3 :D. Nice to see some interest into this topic. :) -
Rozbeh Chiryai Sharahi marked it work in progress 06/23/22, 20:22
-
Rozbeh Chiryai Sharahi uploaded patch set 20 06/23/22, 21:14
-
core-ci voted on patch set 20 V +1 06/23/22, 21:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28372
-
Rozbeh Chiryai Sharahi uploaded patch set 21 06/25/22, 10:51
-
core-ci voted on patch set 21 V -1 06/25/22, 11:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28410
-
Rozbeh Chiryai Sharahi uploaded patch set 22 06/25/22, 15:13
-
core-ci voted on patch set 22 V +1 06/25/22, 15:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28414
-
Rozbeh Chiryai Sharahi uploaded patch set 23 06/26/22, 16:41
-
core-ci voted on patch set 23 V -1 06/26/22, 16:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28424
-
Rozbeh Chiryai Sharahi uploaded patch set 24 06/26/22, 18:22
-
core-ci voted on patch set 24 V -1 06/26/22, 18:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28425
-
Simon Schaufelberger wrote 06/26/22, 18:58
Removed cc Simon Schaufelberger. -
Rozbeh Chiryai Sharahi uploaded patch set 25 06/26/22, 22:03
-
core-ci voted on patch set 25 V -1 06/26/22, 22:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28427
-
Rozbeh Chiryai Sharahi uploaded patch set 26 06/27/22, 11:23
-
Rozbeh Chiryai Sharahi commented on patch set 26 06/27/22, 11:29
This change is ready for review.This change contains a new pattern for generating slugs. I decided for a immutable builder pattern, which can be easily dependency injected and individually configured without the risk of side-effects. Notes: - On workspaces I am not quite sure if this is sufficient, will do more testing - IMO starting and ending slashes should never be stored in DB, but I think this is out of scope and will create a new issue on forge in order to explain my opinion in detail. -
Rozbeh Chiryai Sharahi commented on patch set 26 06/27/22, 11:30
Reply
Done -
core-ci voted on patch set 26 V +1 06/27/22, 11:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28435
-
Stefan Bürk commented on patch set 26 06/27/22, 14:09
This was not useless, it was exclusivly for page records. Other tables/records should not prefix it. Routing is based on "page" and eventually record afterwards, so no need for a full "page slug". This was not "prominent" enough documented in the past / older versiones, but got made clearer in newer documentations: https://docs.typo3.org/m/typo3/reference-tca/11.5/en-us/ColumnsConfig/Type/Slug/Properties/GeneratorOptions.html#confval-generatorOptions:prefixParentPageSlug -
Rozbeh Chiryai Sharahi uploaded patch set 27 06/27/22, 15:09
-
core-ci voted on patch set 27 V +1 06/27/22, 15:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28438
-
Stefan Bürk commented on patch set 27 06/27/22, 16:05
Thanks for this patch .. added some further first comments. Still not deeply reviewed or verified. Still not sure with some options, and maybe adopting more tests will reveal my opionions. Like adopting for: ``` TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\EnhancerSiteRequest\PersistedAliasMapperTest ``` and other tests .. you should build there cases which has "prefixed parent page slugs" in the record slug field and are resolved/executed in page context. For ex.[FEATURE] ...Reply
Maybe you should / adopt more tests,specially in sysext frontend doing frontend requests, building pages with "plugins" and thus using proper "record" routeEnhancers. Prefixing a non-page record with the "parante page slug" do not make any sense. E.g. ``` parent page slug: /some-path/page-slug/ record-title: Record Title generaated record slug in record slug field with parentPage prefix: /some-path/page-slug/record-title Routing with plugin and PersistanteAliasMapper for this record on page ( e.g. with subroute/routePath '/detail/{recordSlug}' would be end up in: /some-path/page-slug/detail/some-path/page-slug/record-title ``` records are not resolved standalone, the are resolved in context of page path. Thus the note in the documentation that "prefixPagePath" is only a option for pages, not for records. Enabling this as default is wrong and lead to a log of breaking confusion. Mabye I'm misleaded, so maybe you can tell/describe a proper use-case why the "parent page" should be directly added to the "slug field" in the database for a record ?Do we really need a option for "that" case ?? Seems kind of superflous - old slughandler handled this without a extra option so far. There has been some patches/bugfixes - maybe your assumptions are not up-to-date ? Or I'm simply getting this wrong.RecordState is a helper class providing prober methods for resolving record parent page with workspace/language etc in mind. So the old slug builder do not have to handle it on it's own (as far as I can tell after a quick peak on it - not investigated deeper). -
Rozbeh Chiryai Sharahi commented on patch set 27 06/27/22, 16:06
Reply
You are right. I will reintroduce the exclusivity for pages, so things are the same as before. Ty for your input. -
Rozbeh Chiryai Sharahi uploaded patch set 28 06/27/22, 16:07
-
core-ci voted on patch set 28 V -1 06/27/22, 16:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28440
-
Rozbeh Chiryai Sharahi commented on patch set 28 06/27/22, 19:09
Reply
I would refer here to the discussion in comment nr. 19.Reply
Thx will changeReply
> Mabye I'm misleaded, so maybe you can tell/describe a proper use-case why the "parent page" should be directly added to the "slug field" in the database for a record ? > Prefixing a non-page record with the "parante page slug" do not make any sense. You are right. I was in a none-frontend tunnel, looking directly on the slug-helper itself. But still I also had mixed feelings when making this decision, which I try to explain: I was thinking: Why would we need a config for prefix-parent-page-slug, when it is exclusive to pages? PrefixParentPageSlug=false made little sense to me on pages and for the others it was ignored, so I somehow end up with at least allowing it for all, but in fact having prefix-parent-page-slug on records, is probably even more kind of a no-sense-scenario. However such a change, even if it was intended, would probably deserve it's own task and might therefor be out-of-scope. I'd suggest to keep the same behavior as on slug-helper?Reply
Aah nice catch. Now thinking on this again, I agree. I guess this is a left-over from some wrong assumptions in the beginning i did. Will remove this. Which is very good, since I don't need to add a new TCA config then. -
Stefan Bürk commented on patch set 28 06/27/22, 22:33
Reply
It make sense for pages to control if you want a page tree in url or plain structure. Mostly all of our customer instances have plan url structures, not page stree structures in url. Some minor mixed mode however (handled through ext:masi). For pages it make sense and there are quite usages out there. ``` Root +--> Page 1 +------ > Subpage 1 /page-1 vs /page-1/subpage-1 in "slug" field of "page" record for subpage 1 ``` Page is the first part which gets resolved. RouteEnhancers and thus "records" or alias get resolved afterwards. Record "should" not contain "path segments", and I think Oliver Hader already worked on a POC to disallow path in records. Allowing paths there to make a "deterministic" und "single-match" something a un-doable task: Think of a record slug of "/subpage-1/record-title-as-slug" as record slug, withput because of "page" not prefixing parent page, but record do it. and a routeEnhancer with routePath: '/{slug}' and a persistenc alias mapping on the record field. And having then a second subpage of "Page 1" with "Title/Slug" of "record-title-a-slug" ``` This easy leads to conflicts. If prepanding, it should be done "without slash". However .. does it really make sensse to have the "path" dublicacted in the "slug pathsegment" ? Seo wise this is questinable. Personally I could not think of a use-case prefixing parent page make sense for records. ``` Url is constructred/splitted and resolved mainly in these parts: ``` <Site/SiteLangugeBase><PagePath><RouteEnhancers> at different places. BASE: https://www.domain.tld/de/ PagePath: /page-1/subpage-1 ExtbasePlugin Enhancer: '/detail/{recordSlug}' and 'my-news-slug' as record Slug => https://www.domain.tld/de/page-1/subpage-1/detail/my-news-slug https://www.domain.tld and https://www.domain.tld/de/ get's resolved "first" in the SiteResolver, then the "PageResolver" would match "/page-1/subpage-1" and afterwards the "enhancer part" through the site router configuration. ``` It's also best practice to not have no-static prefixed routePath's for routeEnhancers (only using a dynamic value) which may interfere with eventual page names or other plugins. Maybe I'm wrong .. could not get a usecase in my mind where this should make any sense for records. Even if option would be "available". Also, updating a "page-slug" would eventually not update the "record" slugs with "page-prefix" which would need additional work and processing if "auto-redirect create on slug change" is active etc ... which only handle subsites, not records. Just some further notes - I mean, we may discuss this option for record if there are usecases which make sense .. but would do that in a dedicated followup change as this needs further adjustments and handlings. I was not there when this got implemented, but I fully can understand why `prefixParentPage` is only a option for pages itself and not records. I really would avoid making "record slugs" handling "more complex" to allowing paths/prefixed pages there as "easy option". -
core-ci voted on patch set 28 V +1 06/27/22, 22:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28440
-
Rozbeh Chiryai Sharahi uploaded patch set 29 06/27/22, 22:41
-
core-ci voted on patch set 29 V +1 06/27/22, 22:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28445
-
Rozbeh Chiryai Sharahi commented on patch set 29 06/27/22, 23:29
Reply
> It make sense for pages to control if you want a page tree in url or plain structure. Mostly all of our customer instances have plan url structures, not page stree structures in url. Some minor mixed mode however (handled through ext:masi). For pages it make sense and there are quite usages out there. 👍 that is indeed a use-case 😊 and for sure deserves a dedicated test. Will do one. > Also, updating a "page-slug" would eventually not update the "record" slugs with "page-prefix" which would need additional work and processing if "auto-redirect create on slug change" is active etc ... which only handle subsites, not records. Yes auto-redirect-create-on-slug-change would definitely need some adjustment. > I really would avoid making "record slugs" handling "more complex" 👍 will do my best, that this does not happen --- So far the outcome of this thread I would summarize as following: prefix-parent-page-slug stays exclusive for pages ---------------- since having parent-page-slugs on none-page-records is not useful considering the way routing is done (site-part/page-part/record-part) prefix-parent-page-slug stays configurable (exclusively) for pages ---------------- in order to support plain- or tree-structure URLs. -
Rozbeh Chiryai Sharahi uploaded patch set 30 06/29/22, 18:25
-
Rozbeh Chiryai Sharahi commented on patch set 30 06/29/22, 18:30
Reply
Done- prefix parent page slug is now exclusive for pages again - a test for plain page structures was added: RecordSlugBuilderTest::canHavePlainUrlStructure - TASK was changed to FEATURE on commit message - removed configuration for pagePageZeroValue => No TCA changes anymoreReply
DoneReply
DoneReply
Done -
Rozbeh Chiryai Sharahi commented on patch set 30 06/29/22, 18:32
Reply
Done -
core-ci voted on patch set 30 V +1 06/29/22, 18:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28512
-
Rozbeh Chiryai Sharahi commented on patch set 30 06/29/22, 21:22
Reply Unresolved
Since you mentioned it, but are not going to investigate deeper, I try to give some info on this. For anybody who is going to deep dive, maybe this helps. #### INTRO: What is record-state: The RecordState is a generic model for any kind of TCA defined table. For instance we have a table tt_content which is configured to have a languageField, languageParent, be workspace-aware, ... RecordStateFactory::forName('tt_content')->fromArray($record) would create an immutable object which can (by $tableName and $record) provide all information like: - Which language? - Which parent language record. - Is new or not? - Is a node (=> table==='pages') - Which default language parent page - ... Knowing the table name and the record values, all the information can be retrieved via TCA configuration and provided as an immutable with handy getters for node, versionLink and issers like isNew (=> uid !== integerish). Even columnsOverride can be considered by record type value. --- Why/when was record-state introduced: Seems like this topic was initiating the change: https://forge.typo3.org/issues/86195 The thread also contains a manual for reproducing the issue, which did not work for me on this branch (v12). Still struggling therefore to have a good test to cover whatever was fixed there. Will see if I can reproduce such a scenario in a test, as soon as I fully understand it. --- Where is record-state used: So far the record-state and it's factory are only used in slug related contexts: - redirect: SlugService - SlugHelper - PopulateNewsSlugs Nevertheless, worth mentioning that, the record-state was strongly used to check unique states of a slugs (where language, workspace, ... is very relevant) as far as I see. On simply creating a slug for a record we should not need info like language-id, language-parent apart from resolving parent-page-slug, where the table is anyway defined (pages) and we therefore can retrieve all info we need by TCA and DB. #### I see in general 3 ways of continuing on this: #1 Dismiss record-state: (Current state) Keep slug-builder and unique-checker work without it, since we already have all information in order to resolve tca-configured fields. $uniqueChecker->for('pages','slug')->check(...) #2 Keep the old approach and use record state as before $uniqueChecker->check(RecordStateFactory::forName('pages')->fromArray($record)) and remove table-name and slug-property awareness of unique-checker. Maybe also implement it on slug-builder, where we need the table-name for post-modifier. But checkout following 3. approach, how complexity might grow. #3 Encapsulate the builders, but use record-state inside. My though here is: Having it as parameter type (like on slug-helper), reduces accessibility, specially if it is a class, which is currently not used anywhere outside slug-context. I might be wrong. By encapsulating the record-state inside unique-checker we would keep on manual setting of slug $uniqueChecker->for('pages', 'slug')->check('my-slug'). instead of $uniqueChecker->check(RecordStateFactory::forName('pages')->fromArray([]), 'my-slug'); , on language>0 with manual string we'd keep $uniqueChecker->for('pages', 'slug')->withLanguageId(1)->check('my-slug'). instead of $recordState = RecordStateFactory::forName('pages')->fromArray(['sys_language'uid' => 1]); $uniqueChecker->check($recordState, 'my-slug'); On the other hand on checking a records slug, it might even be more accessible by record-state: $slug = $recordSlugBuilder->for('pages','slug')->withRecord([])->build(); $uniqueChecker->for('pages', 'slug')->check($slug) becomes $recordState = RecordStateFactory::forName('pages')->fromArray([...]); $uniqueChecker->check($recordState); ... Worth mentioning: In the case of checking a manual slug with language>0, we need to - pass a record-state - pass a string, - _and_ not forget to have record-state containing sys_language_uid=1 It feels wrong, to compose a record array containing sys_language_uid=1 in order to check a manual set slug. the record states language is then used to configure the unique-checking. At least for me, this seems quite complex to grasp and very hidden, not saying that I would always argue like this. Maybe I need to get used to it. Worth mentioning here: The record-state was never used in none-slug-context afaik. I guess because no sufficient popular documention? This might also be why it feels unhandy to me. -
Rozbeh Chiryai Sharahi uploaded patch set 31 06/29/22, 23:08
-
core-ci voted on patch set 31 V +1 06/29/22, 23:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28514
-
Rozbeh Chiryai Sharahi uploaded patch set 32 07/01/22, 13:08
-
core-ci voted on patch set 32 V +1 07/01/22, 13:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28571
-
Rozbeh Chiryai Sharahi commented on patch set 32 07/01/22, 13:24
1- I changed all configuration-method-names, which do more than what simple withers do, to for...: ->for(table, field) ->forRecord([]) ->withPrependSlash(false) 2- I removed superflous preserveEndingSlash from record-slug-builder, since there is no current use-case 3- I updated the commit message to the current state 4- I updated documentation according to the changes -
Benni Mack commented on patch set 32 07/04/22, 15:06
do we still need the SlugHelper then? -
Rozbeh Chiryai Sharahi commented on patch set 32 07/04/22, 21:33
Reply
It is still used in \TYPO3\CMS\Redirects\Service\SlugService Will change that. -
Rozbeh Chiryai Sharahi uploaded patch set 33 07/04/22, 22:06
-
Rozbeh Chiryai Sharahi commented on patch set 33 07/04/22, 22:10
Reply
Done- I replaced the usage of slug-helper in redirects/slug-service - I updated the commit message (first what was implemented, then why was it implemented) -
Rozbeh Chiryai Sharahi commented on patch set 33 07/04/22, 22:19
Reply
I think not. I replaced all usages of slug-helper. I am not sure if I should put deprecation annotations in this or another patch though. -
core-ci voted on patch set 33 V -1 07/04/22, 22:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28641
-
Rozbeh Chiryai Sharahi uploaded patch set 34 07/04/22, 22:23
-
core-ci voted on patch set 34 V +1 07/04/22, 22:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28642
-
Rozbeh Chiryai Sharahi uploaded patch set 35 07/05/22, 22:09
-
Rozbeh Chiryai Sharahi commented on patch set 35 07/05/22, 22:12
- I improved the documentation (examples and text) - I updated record-slug-builder to pass it's configuration to the string-slug-builder instead of retrieving it via TCA (see: RecordSlugBuilder::buildRecordSlug). -
core-ci voted on patch set 35 V +1 07/05/22, 22:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28683
-
Andreas Wolf uploaded patch set 36
V +107/06/23, 15:46 -
core-ci voted on patch set 36 V -1 07/06/23, 16:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43768
-
Mathias Bolt Lesniak uploaded patch set 37
V -104/10/24, 17:02 -
core-ci voted on patch set 37 V -1 04/10/24, 17:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55697
-
Mathias Bolt Lesniak uploaded patch set 38
V -104/12/24, 10:43 -
core-ci voted on patch set 38 V -1 04/12/24, 10:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55854
-
Mathias Bolt Lesniak uploaded patch set 39
V -104/12/24, 12:51 -
core-ci voted on patch set 39 V -1 04/12/24, 12:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55867
-
Mathias Bolt Lesniak uploaded patch set 40
V -104/12/24, 14:11 -
core-ci voted on patch set 40 V -1 04/12/24, 14:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55874
-
Rozbeh Chiryai Sharahi uploaded patch set 41
V -104/12/24, 21:05 -
Rozbeh Chiryai Sharahi uploaded patch set 42 04/12/24, 21:09
-
core-ci voted on patch set 41 V -1 04/12/24, 21:12 Copied votes on follow-up patch sets have been updated: * Verified-1 has been copied to patch set 42 (copy condition: "changekind:NO_CHANGE"). Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55880
-
core-ci voted on patch set 42 V -1 04/12/24, 21:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55881
-
Rozbeh Chiryai Sharahi uploaded patch set 43
V -104/12/24, 21:21 -
core-ci voted on patch set 43 V -1 04/12/24, 21:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55882
-
Rozbeh Chiryai Sharahi uploaded patch set 44
V -104/13/24, 09:14 -
core-ci voted on patch set 44 V -1 04/13/24, 09:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55904
-
Rozbeh Chiryai Sharahi uploaded patch set 45
V -104/13/24, 09:36 -
Rozbeh Chiryai Sharahi uploaded patch set 46 04/13/24, 09:41
-
core-ci voted on patch set 45 V -1 04/13/24, 09:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55905
-
core-ci voted on patch set 46 V -1 04/13/24, 09:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55906
-
Rozbeh Chiryai Sharahi uploaded patch set 47
V -104/13/24, 10:36 -
core-ci voted on patch set 47 V +1 04/13/24, 10:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55907
-
Rozbeh Chiryai Sharahi updated the commit message in patch set 48
V +104/13/24, 10:45 -
core-ci voted on patch set 48 V +1 04/13/24, 10:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55908
-
Chris Müller uploaded patch set 49
V +104/13/24, 16:55 -
core-ci voted on patch set 49 V +1 04/13/24, 17:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55915
-
Rozbeh Chiryai Sharahi uploaded patch set 50
V +104/14/24, 08:32 -
core-ci voted on patch set 50 V +1 04/14/24, 08:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55939
-
Rozbeh Chiryai Sharahi uploaded patch set 51
V +104/16/24, 21:55 -
core-ci voted on patch set 51 V -1 04/16/24, 22:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56102
-
Mathias Bolt Lesniak uploaded patch set 52
V -104/17/24, 05:20 -
core-ci voted on patch set 52 V -1 04/17/24, 05:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56126
-
Mathias Bolt Lesniak uploaded patch set 53
V -104/17/24, 05:38 -
Mathias Bolt Lesniak uploaded patch set 54 04/17/24, 05:41
-
core-ci voted on patch set 53 V -1 04/17/24, 05:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56127
-
core-ci voted on patch set 54 V +1 04/17/24, 05:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56128
-
Mathias Brodala commented on patch set 54 04/17/24, 07:47
SlugHelper.php:106Please add a deprecation RST for this. It may link to the feature RST for details. Example: https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Breaking-96526-RemovedHooksForModifyingPageModuleContent.html#migration
-
Mathias Bolt Lesniak commented on patch set 54 04/17/24, 08:14
SlugHelper.php:106ReplyI guess you mean more like this, since it's not yet a breaking change: https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Deprecation-95456-IntroduceBootstrap5CompatibleAndAccessibleTemplates.html#deprecation-95456-deprecate-legacy-form-templates It should be two separate files, separate from the feature change, right? -
Mathias Brodala commented on patch set 54 04/17/24, 08:30
SlugHelper.php:106ReplyYes please. -
Rozbeh Chiryai Sharahi uploaded patch set 55
V +104/17/24, 19:08 -
Rozbeh Chiryai Sharahi commented on patch set 55 04/17/24, 19:13
SlugHelper.php:106Reply@mbrodala@pagemachine.de Thanks for the input. Could you check if I did that correctly and if yes, resolve the thread? -
core-ci voted on patch set 55 V -1 04/17/24, 19:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56188
-
Rozbeh Chiryai Sharahi uploaded patch set 56
V -104/17/24, 22:12 -
core-ci voted on patch set 56 V -1 04/17/24, 22:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56190
-
Rozbeh Chiryai Sharahi uploaded patch set 57
V -104/17/24, 22:24 -
core-ci voted on patch set 57 V -1 04/17/24, 22:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56191
-
Rozbeh Chiryai Sharahi uploaded patch set 58
V -104/17/24, 22:32 -
core-ci voted on patch set 58 V -1 04/17/24, 22:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56192
-
Rozbeh Chiryai Sharahi uploaded patch set 59
V -104/17/24, 22:39 -
core-ci voted on patch set 59 V +1 04/17/24, 22:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56193
-
Mathias Brodala commented on patch set 59 04/18/24, 05:20
SlugHelper.php:106ReplyAcknowledged -
Rozbeh Chiryai Sharahi commented on patch set 59 04/18/24, 08:03
Reply
@benni@typo3.org In the end deprecations were added within this change. -
Rozbeh Chiryai Sharahi commented on patch set 59 04/18/24, 08:03
Reply
Done -
Stefan Bürk commented on patch set 59 CR -2 04/18/24, 15:04
Unresolved
Soft / temp -2 currently on this. Will align with lolli on that to discuss some thing first, and will come back with further feedback (tomorrow). Please, don't put more work currently into this until the feedback. Thanks. Note: The -2 is not meant as a COMPLETE block and will be removed after feedback tomorrow. -
Christian Kuhn commented on patch set 59 CR -1 04/23/24, 12:16
Hey. Thanks for the patch, this reflects a lot of work. This patch is a challenge to review, and needs some time. Even though I'm not very deep into the slug internals, a couple of things come to my mind: * (detail): exception that can be caught should extend (in this case) from core/exception. * (detail): i'm unsure about the 'prependSlash' option - this turns the default around? * codestyle: the classes are underdocumented. it is for instance not obvious to me what RecordSlugBuilder and StringSlugBuilder are for and when / where they should be used and how they work together. * New service classes should be designed to be final in general. * The new method in BackendUtility: columnOverrides is to change display options only. extending this to non-display things (which may have happened already) and extracting the merge operation to the mess class BackendUtility should probably be avoided and rethought. * RecordSlugUniqueChecker: This actually changes the slug and prepends counters, right? If so, the name is misleading since it not only checks, but modifies. * (general): In general the patch feels too big, and very hard to review. It would be better to split things into smaller chunks. * (general): I'm totally unsure if the proposed architecture is the way to go. We could for instance come up with different solutions to make the SlugHelper DI-aware, if that is one of the main issues. One solution could be to make the __construct() arguments nullable, extend the single methods with appropriate arguments, deprecate manual constructor arguments in v13, and introduce DI in v14. * (general): I'm not sure if we should really follow the stateful immutable approach of the patch: We still end up with stateful services. If I'd try to redesign a class like SlugHelper, I'd first try to come up with a factory pattern instead. * (general): I'm not sure if separating concerns into these three classes is really the way to go. It feels a bit arbitrary to me, but I'd have to have a deeper look at the current construct and strategy to really understand if this is a natural solution. * (general): We may want to create a substitution construct with performance (especially db-query-count wise) in mind. DataHandler is the main user of the construct, and DH in general suffers from the bad habit of fetching the same rows over and over again, even though DH has many at hand already. A revamp of such "child" classes should prepare for optimized handling in this area. Imho, to push this further, we should have a more dedicated look at SlugHelper and think about structural solutions in a team again, involving a trained core-dev who can decide on things and a strategy to split details. A good opportunity could be a community sprint, or the DevDays, or voice talks. I don't want to frustrate you, and really don't want to neglect your work, but I have the strong feeling we need some dedicated coordination here. I'm looking forward on this. -
Rozbeh Chiryai Sharahi commented on patch set 59 04/24/24, 13:42
Reply
Hey Christian Kuhn, first of all I want to also thank you for the code-review. I know, how much effort it takes to code-review a branch with so many changes in a topic which was probably not at all on your desk until yesterday. I appreciate that a lot. I am not at all discouraged or frustrated. If I can somehow help, I will. I basically agree to all of your points you mentioned and consider the fact, that this is one-big-long-living-branch as the most evil of all. The branch is very old and from todays perspective I'd not do it like this again. A step by step approach would have made this change more easy to review and discuss. Regarding the other points, I will still give some feedback. Not to justify the approaches, just to have documented, what the background of those concepts were. Maybe some of those backgrounds are considerable even on a complete different implementation. Nevertheless, this will only happen tomorrow, as today I take care of some kids 😄 Kind regards Rozbeh -
Rozbeh Chiryai Sharahi commented on patch set 59 04/29/24, 17:41
Reply
Hello, as I promised some background this implementation. ad exception) check ad prependSlash) No i didn't change the default. Prepend slash was before hard coded for the table `pages` to be true. I just removed the dedicated `pages`-table if statement and added the config to pages.php tca-config. Otherwise a lot of tests would fail. ad final classes) Check, I was not aware of that in TYPO3 context ad BackendUtility) Yes you are totally right. ad RecordSlugUniqueChecker) If you have a good name for it, I'd be super happy. For instance RecordSlugUniquifier ? Not sure... ad big patch) Yes that is very bad ad SlugHelper DI aware) Having a lot of nullable constructor arguments is not a prefered pattern of mine. But of course it would be a small change compared to my xxl sized branch :) ad Statefull Immutables) Background: The current implenentation has the advantage that you can configure your slug-builder with `withers` and once this process is done, the same instance can be used within a loop for multiple records. That should perform very well, due to always being the same instance. Now of course I also thoughed of creating factories but everytime i approached it, it ended up in a very ambigious and inflexible solution bringing too much complexity. Nevertheless maybe somebody else knows a better solution to the three key motivations that drove me: 1- No side-effects, 2- performs in loops, 3- accessible interface, 4- extendable. But maybe I missed the target or had wrong motivations. ad seperating concerns) I would definitly seperate that concerns. I think that is the key point why it is much easier to use this approach, compared to the current slug-helper. - StringSlugHelper just turns any string to a slug "Here WE GO" => "here-we-go". It is not aware of any records nor database. - RecordSlugBuilder does the same but takes into consideration the underlying record. It reads the input from the record, based on whatever is configured on tca. - UniqueChecker does only check for uniqueness. It is not interested into where the slug actually comes from. It takes the string given and modifies it, if not unique (based on tca). ad performance) The underlying sql statements I basically just took over from the old implementation. There should not be any difference in performance, if I am not wrong. -
Mathias Bolt Lesniak commented on patch set 59 04/29/24, 18:14
Reply Unresolved
ad RecordSlugUniqueChecker) Maybe two classes? `SlugUniquenessValidator` for the check and a `SlugAffixer` (or `SlugUniqueAffixer`) to add prefix or postfix to the slug. -
Benni Mack commented on patch set 59 03/25/25, 15:31
I will set this to WIP for the time being. I don't know the current status but it has been awfully quiet in this change for almost a year now. -
Benni Mack marked it work in progress 03/25/25, 15:31
-
Benni Mack commented on patch set 59 10/23/26, 05:46
please let me know what to do here. Otherwise I will abandon this change, as it won't be revived easily I assume? -
Mathias Bolt Lesniak commented on patch set 59 10/23/26, 09:04
Reply
@benni@typo3.org As far as I remember this was going to be picked up after the completion of #85574