77633[FEATURE] Introduce SlugRedirectChangeItemCreatedEvent
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Oli Bartsch +1
- Benni Mack +1
-
Verified V +2 Done
- Stefan Bürk +2
- Oli Bartsch +1
- Benni Mack +1
- core-ci +1 CI
Issues 2
Files 9
- typo3/sysext/core/Documentation/Changelog/12.2/Feature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst21new+110 −0
- typo3/sysext/redirects/Classes/Event/SlugRedirectChangeItemCreatedEvent.phpnew+47 −0
- typo3/sysext/redirects/Classes/EventListener/AddPlainSlugReplacementSource.php3new+49 −0
- typo3/sysext/redirects/Classes/RedirectUpdate/SlugRedirectChangeItemFactory.php+10 −17
- typo3/sysext/redirects/Configuration/Services.yaml+5 −0
- typo3/sysext/redirects/Tests/Functional/EventListener/Fixtures/SimpleSiteRoot.csvnew+3 −0
- typo3/sysext/redirects/Tests/Functional/EventListener/AddPlainSlugReplacementSourceTest.phpnew+78 −0
- typo3/sysext/redirects/Tests/Functional/RedirectUpdate/SlugRedirectChangeItemFactoryTest.php+41 −0
- typo3/sysext/redirects/Tests/Unit/Event/SlugRedirectChangeItemCreatedEventTest.phpnew+78 −0
Review log 2130
Show 35 earlier messages
-
Stefan Bürk uploaded patch set 1 01/30/23, 05:37
-
core-ci voted on patch set 1 V +1 01/30/23, 05:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36747
-
Stefan Bürk uploaded patch set 2
V +101/30/23, 07:18 -
Stefan Bürk uploaded patch set 3 01/30/23, 07:20
-
core-ci voted on patch set 3 V +1 01/30/23, 07:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36751
-
core-ci voted on patch set 2 V +1 01/30/23, 07:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36750
-
Georg Ringer voted on patch set 3 V +1 CR +1 01/30/23, 07:44
-
Oli Bartsch commented on patch set 3 01/30/23, 10:42
I would like to see two additional tests for the new Event. 1. A test for the factory which ensures, the event is called properly 2. A test for the events' methods. You can have a look at latest introduced events for examples: E.g. https://review.typo3.org/c/Packages/TYPO3.CMS/+/77606/5/typo3/sysext/lowlevel/Tests/Functional/ConfigurationModuleProvider/GlobalVariableProviderTest.php and https://review.typo3.org/c/Packages/TYPO3.CMS/+/77606/5/typo3/sysext/lowlevel/Tests/Unit/Event/ModifyBlindedConfigurationOptionsEventTest.phpor to removeuseful to ensurebyonavailableFurther eventsregistering their listeners after the core listeneranbuilding?Feature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:14This can IMO be skipped as it's include in the class name.Feature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:29when their listeners are registered and executed afterwards. See the example below.Feature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:33Can we skip this sentence and add replace the "it is recommended" with "it is required" in the previous sentence?Feature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:35I think this is far to technical for an RST. Also i tend to avoid terms like "easy" and similar.Feature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:110The new Event With the new :php:`SlugRedirectChangeItemCreatedEvent`, it's possible to manage the redirect sources for which redirects should be created. It furthermore allows to influence existing Core functionality.AddPlainSlugReplacementSource.php:25Lets mark this listener as @internal -
Stefan Bürk commented on patch set 3 CR -1 01/30/23, 10:47
Reply
Thanks for the example .. searched not long enough, just took the RedirectWasHit Event and listener tests as kind of example. Will extend them later.AddPlainSlugReplacementSource.php:25ReplyMissed that, ack. -
Stefan Bürk uploaded patch set 4
CR +1V +101/31/23, 10:52 -
Stefan Bürk updated the commit message in patch set 5 01/31/23, 10:54
-
Stefan Bürk commented on patch set 5 01/31/23, 10:55
Reply
Done. Hope I fully tackled what you ment.Reply
DoneReply
DoneReply
DoneReply
DoneReply
DoneReply
DoneReply
DoneReply
DoneReply
DoneFeature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:14ReplyDoneFeature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:29ReplyDoneFeature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:33ReplyDoneFeature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:35ReplyDoneFeature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:110ReplyDoneAddPlainSlugReplacementSource.php:25ReplyDone -
core-ci voted on patch set 4 V +1 01/31/23, 11:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36812
-
core-ci voted on patch set 5 V +1 01/31/23, 11:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36813
-
Lina Wolf commented on patch set 5 01/31/23, 11:47
Feature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:25Please use FQN when ever class is first mentioned in one fileFeature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:31I have trouble understanding this sentence, it is a bit confusingFeature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:46I would maybe first show the implementation of the event listener and then the RedirectSourceImplementation. Also, do you need to implement it or is an anonymous class enough? -
Lina Wolf commented on patch set 5 01/31/23, 11:48
Feature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:22This does not really give more information then the method name and parameters?Feature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:23How to unset? By setting it to null? This should be mentioned -
Stefan Bürk uploaded patch set 6
V +102/02/23, 07:39 -
Stefan Bürk commented on patch set 6 02/02/23, 07:39
Feature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:22ReplyI cloned this basically from other event introduction changelog entries. Sure, it may be useless to state - if someone would lookup directly in the code. But than, why are we stating the methods here and in other places when people can lookup the code itself ?. And as it can be `null` it raises the wareness here, as the name of the getter alone would not reflect this. The descrtipn at least states that it can be null which the method name does not express. (and having a "getXXXorNull()" method name seems to be odd - codewise with the native type hints thats okay, for a changelog it's ok to express it here. Hope that's fine with you. However, changed that a bit along with the setter.Feature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:23ReplyDoneFeature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:25ReplyDoneFeature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:31ReplyLet's have a call on that - maybe I can explain it and you can help me with a better fitting description here than. Instead of having a long "try-to-explain-and-find-correct-wording" tree here.Feature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:46ReplyAck on moving the example below the listener. Basically it's "ok" to add a anonymous class as source - however, it's still a kind of "custom implementation" as the anonymous class must implement the interface and therefor the defined methods doing something "usefull". I would put anonymous classes more into "advanced knowledge", especially in proper usage and knowing the pro/cons of it. Thus, I would say a "concrete" example here is better fit instead of a anonymous class. Looking forwared, I have plans to add further events to `ext:redirects` - and there it would be hard to proberly identify a "concrete" anonymous class (or it must add some kind of identification) whereas with concrete implementation of the source that can be done with a "simple" `instanceof check`. For know, core only implements the plain source - which can be removed deting by the class (as in the example). With anouter patch I plan to introduce a additional concrete core source implementation (which may be reused) for a specific source type. Still, using a concrete implementation here showcases, in addition to the later event, how do define here a concrete class and identify it later (for controlling the redirect record and data set based on that). I would advice against using a anonymous class here. -
core-ci voted on patch set 6 V +1 02/02/23, 07:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36916
-
Lina Wolf commented on patch set 6 V +1 CR +1 02/02/23, 07:58
Reviewed the Changelogentry, otherhave to review the patchFeature-99746-NewPSR-14SlugRedirectChangeItemCreatedEvent.rst:31ReplyAck Let as spoken let it keep like this for now -
Stefan Bürk uploaded patch set 7
CR +1V +102/02/23, 20:20 -
Oli Bartsch uploaded patch set 8 02/02/23, 20:43
-
Oli Bartsch updated the commit message in patch set 9 02/02/23, 20:45
-
Oli Bartsch voted on patch set 9 V +1 CR +1 02/02/23, 20:45
-
core-ci voted on patch set 7 V -1 02/02/23, 20:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36934
-
core-ci voted on patch set 8 V +1 02/02/23, 20:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36935
-
core-ci voted on patch set 9 V +1 02/02/23, 20:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36936
-
Benni Mack voted on patch set 9 V +1 CR +1 02/02/23, 21:46
-
Stefan Bürk voted on patch set 9 V +2 CR +2 02/02/23, 22:40
-
Stefan Bürk merged patch set 10 02/02/23, 22:40