71153[BUGFIX] Create auto-redirects after slug change using DataHandler
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 2
Files 2
Review log 3241
Show 1216 earlier messages
-
Stefan Bürk uploaded patch set 1 09/21/21, 07:28
-
Mathias Brodala commented on patch set 1 CR -1 09/21/21, 07:37
SlugService.php:164There are spaces missing around the "=" here. Also you don't need to initialize $data like this, you can directly create it with the lone "sys_redirect" entry.SlugService.php:169These three can be dropped since they are set by the DataHandler already.SlugService.php:179Never seen such a check. Is there a case where the DataHandler would silently fail and make this check necessary? -
Stefan Bürk commented on patch set 1 09/21/21, 07:43
SlugService.php:163ReplySry, what do you mean exactly ? Without the "_" or another Utillity/Method ?SlugService.php:179ReplyYes, if backend user is not allowed to add records on that page - or recordes are not allowed on that page/doktype. Then it holds an error in the errorLog property and substNEWwithIDs is empty/not set. Have added sys_record to alllow for default pages - should we really ommit here a check ? Or is another kind of check prefered ? -
core-ci voted on patch set 1 V +1 09/21/21, 07:47 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16968
-
Mathias Brodala commented on patch set 1 09/21/21, 07:47
SlugService.php:163ReplyYes, just drop the "_". It's minor but consistent with 90% of the remaining places. (In fact I only found 2 occurrences of "NEW_".)SlugService.php:179ReplyI just had another look and it looks like quite a few places more or less do the same check. So it should be fine. -
Stefan Bürk uploaded patch set 2 09/21/21, 08:04
-
Stefan Bürk commented on patch set 2 09/21/21, 08:05
SlugService.php:163ReplydoneSlugService.php:164Replydone (removed)SlugService.php:169Replydone (dropped) -
Mathias Brodala commented on patch set 2 CR +1 09/21/21, 08:17
SlugService.php:163ReplyDoneSlugService.php:164ReplyDoneSlugService.php:169ReplyDone -
core-ci voted on patch set 2 V +1 09/21/21, 08:26 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16971
-
Johannes Seipelt voted on patch set 2 CR +1 09/21/21, 08:36
-
Simon Schaufelberger updated the commit message in patch set 3 09/22/21, 01:18
-
core-ci voted on patch set 3 V +1 09/22/21, 01:33 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17011
-
Björn Jacob commented on patch set 3 CR -1 09/22/21, 09:02
I do not understand the commit message. It is very hard to read. Here is my proposal: --- In TYPO3 v10 creation of auto-redirects after slug change has been added using database queries. Thus neither TCA defaults have been respected nor hooks are implemented to achieve instance specific manipulations. Furthermore, the current implementation does not check if redirect records are allowed to be created for (default) pages. This would be done by DataHandler. The patch adds 'sys_redirect' to allowedTables for default pages, as they are created with pid if the slug has changed. In addition, now DataHandler is used to create auto-redirects, thus respecting TCA defaults, if not overridden by required values or extension configuration. --- Do you like it? -
Stefan Bürk updated the commit message in patch set 4 09/22/21, 10:54
-
Stefan Bürk commented on patch set 4 09/22/21, 10:55
Reply
Changed. -
core-ci voted on patch set 4 V +1 09/22/21, 11:08 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17025
-
Johannes Seipelt voted on patch set 4 CR +1 09/22/21, 12:18
-
Stefan Bürk commented on patch set 4 CR -1 09/27/21, 08:16
This patch is blocked for now. We get two other patches in first, one with backport. Doing this and the and, as it will be master/v11 only. -
Stefan Bürk uploaded patch set 5 10/03/21, 17:02
-
core-ci voted on patch set 5 V +1 10/03/21, 17:21 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17517
-
Guido Schmechel commented on patch set 5 10/04/21, 19:06
Tested in current master: - Setup an editor role without access for sys_redirect table and fields - Change a pagetitle with editor role ("Simulate user"), not a direct login - Failed in PHP 7.4 with "Cannot unpack array with string keys" / PHP 8 with "sprintf() does not accept unknown named parameters" Seems to be a problem after this patch: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70858 Why do we suddenly have too many arguments for logging? https://github.com/TYPO3/typo3/blob/master/typo3/sysext/core/Classes/Error/ErrorHandler.php#L254 (1/1) Error Cannot unpack array with string keys in /var/www/html/typo3/sysext/core/Classes/DataHandling/DataHandler.php line 8859 at TYPO3\CMS\Core\DataHandling\DataHandler->printLogErrorMessages() in /var/www/html/typo3/sysext/backend/Classes/Controller/EditDocumentController.php line 752 -
Oli Bartsch rebased onto patch set 6 10/04/21, 20:53
-
Helmut Hummel voted on patch set 6 CR +1 10/04/21, 21:08
-
Andreas Kienast voted on patch set 6 CR +1 10/04/21, 21:12
-
core-ci voted on patch set 6 V +1 10/04/21, 21:15 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17592
-
Oli Bartsch commented on patch set 6 CR -1 10/04/21, 21:28
Will updateSlugService.php:185This is the default valueSlugService.php:189This is the default valueSlugService.php:190Will lead to a TypeError in case $record is NULL. -
Oli Bartsch uploaded patch set 7 10/04/21, 21:30
-
Oli Bartsch commented on patch set 7 V +1 CR +1 10/04/21, 21:31
SlugService.php:185ReplyDoneSlugService.php:189ReplyDoneSlugService.php:190ReplyDone -
Oli Bartsch commented on patch set 7 V 0 CR 0 10/04/21, 21:39
With this patch, the automatic redirect creation only works in case the current user has permissions to create redirects. Is this intended? -
core-ci voted on patch set 7 V +1 10/04/21, 21:43 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17593
-
Helmut Hummel voted on patch set 6 CR 0 10/04/21, 21:47
-
Oli Bartsch commented on patch set 7 10/04/21, 22:06
Reply
This also relates to https://forge.typo3.org/issues/93370. The whole "automatic redirect generation" topic IMO needs some more conceptual work. For example, should automatic slug generation work for users not having necessary table modify permission? Should the "revert" option always work? If not, then the corresponding notification action should not be displayed, right? -
Stefan Bürk commented on patch set 7 CR -1 10/05/21, 05:22
Thx Oliver and others for the review and the changes. -1 for now.Reply Unresolved
No, this was not intended. The original intend was to use the defaults and implemented ways to define these defaults (TCA, ...) and give the possibility to hook into it. Secondly there was a todo to use DataHandler. And now I know why. Simply oversight of the permissions. Even if the decision is to go down to respect permissions, this patch has to be chaned to give propper feedback. Ack. We should work on the conceptual for "automatic redirects" first instead of nit-changing on several places without concept. Let's talk about this ... after lts and getting some breathings. Anywayy - saw that permission issue yesterday but shutdown the computer to fast, and forgot to give this patch myself -1 for now. -
Benni Mack wrote 11/29/21, 10:12
Change destination moved from master to main -
Benni Mack updated the commit message in patch set 8 11/29/21, 13:37
-
core-ci voted on patch set 8 V +1 11/29/21, 15:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20053
-
Andreas Kienast rebased onto patch set 9 01/30/22, 10:58
-
Andreas Kienast voted on patch set 9 CR +1 01/30/22, 10:58
-
core-ci voted on patch set 9 V +1 01/30/22, 11:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22709
-
Stefan Bürk commented on patch set 9 CR -1 01/30/22, 13:00
Reply Unresolved
reopening this -1 comment. this still standsPermission issue still exists as reported by Oliver. Has still be relooked and thought about that all. Thus reputting block -1. -
Stefan Bürk abandoned the change 02/10/23, 16:44
There are some events in the making to circumence the permission issue. Will retry this at a later point, not feasonable right now.
SlugService.php:163