79568[FEATURE] Deprecate and replace DuplicationBehavior class with enum
Commit message
Review
-
Code review CR +2 Done
- Nikita Hovratov +2
- Andreas Kienast +1
-
Verified V +2 Done
- Nikita Hovratov +2
- Andreas Kienast +1
- core-ci +1 CI
Issues 2
Files 18
- typo3/sysext/backend/Classes/Controller/File/FileController.php+6 −8
- typo3/sysext/core/Classes/Resource/Enum/DuplicationBehavior.php8new+78 −0
- typo3/sysext/core/Classes/Resource/OnlineMedia/Helpers/AbstractOnlineMediaHelper.php+1 −1
- typo3/sysext/core/Classes/Resource/AbstractFile.php10+37 −3
- typo3/sysext/core/Classes/Resource/DuplicationBehavior.php+1 −0
- typo3/sysext/core/Classes/Resource/FileInterface.php11+4 −1
- typo3/sysext/core/Classes/Resource/FileReference.php+3 −1
- typo3/sysext/core/Classes/Resource/Folder.php6+46 −4
- typo3/sysext/core/Classes/Resource/InaccessibleFolder.php+8 −4
- typo3/sysext/core/Classes/Resource/ResourceStorage.php5+79 −27
- typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php+11 −31
- typo3/sysext/core/Documentation/Changelog/13.0/Deprecation-101151-DuplicationBehaviorClass.rst2new+39 −0
- typo3/sysext/core/Documentation/Changelog/13.0/Feature-101151-DuplicationBehavior.rst2new+34 −0
- typo3/sysext/core/Tests/Functional/Resource/StorageRepositoryTest.php+5 −5
- typo3/sysext/filelist/Classes/Controller/FileListController.php4+5 −31
- typo3/sysext/impexp/Classes/Controller/ImportController.php+2 −2
- typo3/sysext/impexp/Classes/Export.php+2 −1
- typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php3+6 −1
Review log 87112
Show 6787 earlier messages
-
Thomas Hohn uploaded patch set 1 06/30/23, 08:58
-
core-ci voted on patch set 1 V -1 06/30/23, 09:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43139
-
Thomas Hohn uploaded patch set 2
V -106/30/23, 09:36 -
core-ci voted on patch set 2 V -1 06/30/23, 09:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43141
-
Thomas Hohn uploaded patch set 3
V -106/30/23, 10:18 -
core-ci voted on patch set 3 V +1 06/30/23, 10:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43149
-
Thomas Hohn uploaded patch set 4
V +106/30/23, 12:47 -
core-ci voted on patch set 4 V +1 06/30/23, 12:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43153
-
Oliver Klee commented on patch set 4 06/30/23, 14:10
-
Thomas Hohn uploaded patch set 5
V +106/30/23, 14:17 -
Thomas Hohn commented on patch set 5 06/30/23, 14:17
DuplicationBehavior.php:3ReplyDone -
core-ci voted on patch set 5 V +1 06/30/23, 14:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43156
-
Benni Mack rebased onto patch set 6
V +107/06/23, 10:41 -
core-ci voted on patch set 6 V +1 07/06/23, 10:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43694
-
Oliver Klee voted on patch set 6 V +1 07/06/23, 11:25
-
Oliver Klee commented on patch set 6 07/15/23, 11:35
Could you please rebase to solve the merge conflicts? -
Thomas Hohn uploaded patch set 7
V +107/15/23, 15:02 -
Thomas Hohn commented on patch set 7 07/15/23, 15:03
Reply
Done -
core-ci voted on patch set 7 V +1 07/15/23, 15:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44174
-
Oliver Klee voted on patch set 7 V +1 07/15/23, 15:12
-
Oliver Klee commented on patch set 7 V 0 07/15/23, 15:13
FileInterface.php:127We should remove the outdated `@param` annotation for all affected usages of the `$conflictmode` argument. -
Thomas Hohn commented on patch set 7 07/15/23, 19:46
FileInterface.php:127ReplySo you want to remove all places where the @param string $conflictMode is present? -
Oliver Klee commented on patch set 7 07/15/23, 21:36
FileInterface.php:127ReplyExactly. :-) (Currently, the PHPDoc `@param` annotation and the native type declaration are out of sync. So we either need to adapt the PHPDoc annotations or remove them. As the PHPDoc annotations do not add anything over the native type declaration, I'd opt for removing them.) -
Thomas Hohn commented on patch set 7 07/16/23, 14:40
FileInterface.php:127ReplyHad a second look - I think we should clean it up with TYPO3 v14.0 - it seems that I forgot to change it for this class. Instead we could tighten the signatures as an additional pre -
Oliver Klee commented on patch set 7 07/16/23, 14:46
FileInterface.php:127ReplySounds good to me. -
Alexander Schnitzler commented on patch set 7 07/19/23, 05:37
ResourceStorage.php:1234Why is the fallback `CANCEL` here when the default of the method param is `RENAME`? Same for all the other methods. -
Thomas Hohn commented on patch set 7 07/19/23, 06:22
ResourceStorage.php:1234ReplyMight have been an mis-interpretation of what the previous cast method would have returned for a non-existing illegal value -
Alexander Schnitzler uploaded patch set 8
V +107/20/23, 14:09 -
Alexander Schnitzler commented on patch set 8 07/20/23, 14:11
ResourceStorage.php:1234ReplyNo no, you are right here. -
core-ci voted on patch set 8 V +1 07/20/23, 14:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44348
-
Thomas Hohn uploaded patch set 9
V +107/25/23, 19:13 -
core-ci voted on patch set 9 V +1 07/25/23, 19:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44553
-
Thomas Hohn commented on patch set 9 08/01/23, 11:57
FileInterface.php:127ReplyDo we still want to do this? I saw a PR from you with AbstractFile that had some issues -
Oliver Klee commented on patch set 9 08/01/23, 12:08
FileInterface.php:127ReplyThat probably was Alex' change that had to be reverted: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80233 I'd assume that Alex (or someone else) will first fix the problems in separate changes and then re-create the change for adding type declarations to AbstractFile. I think that having Alex' change first and then this one here would be way that is less stressful. So maybe let's mark this change here as WIP and revisit and rebase it once Alex' change is merged. -
Oliver Klee commented on patch set 9 08/01/23, 12:24
FileInterface.php:127ReplyWhat do you think, Thomas? -
Thomas Hohn commented on patch set 9 08/01/23, 12:29
FileInterface.php:127ReplyLet's see what comes first. The is still this issue and another enumeration issue open before the Class Enumeration can be marked as deprecated. If https://review.typo3.org/c/Packages/TYPO3.CMS/+/79571 is merged fast - Id opt for getting this issue fixed ASAP so we can finish the enumeration class stuff -
Alexander Schnitzler commented on patch set 9 08/01/23, 13:47
FileInterface.php:127ReplyI have a new patch online but as WIP because I was told we should remain calm to not endanger the coding night. If this will be merged before mine, no problem. I know how to rebase. :) So, don't hold this back for me. -
Thomas Hohn commented on patch set 9 08/15/23, 04:55
FileInterface.php:127ReplyDone -
Thomas Hohn uploaded patch set 10
V +109/22/23, 05:00 -
core-ci voted on patch set 10 V -1 09/22/23, 05:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47045
-
Thomas Hohn uploaded patch set 11
V -109/22/23, 05:47 -
core-ci voted on patch set 11 V +1 09/22/23, 05:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47047
-
Simon Schaufelberger commented on patch set 11 09/22/23, 08:13
AbstractFile.php:492I prefer the same deprecation message format like: xxx has been deprecated in TYPO3 v13.0 and will be removed in v14.0ClassNameMatcher.php:2354huh, what happened with the IconState? Why did you replace that? -
Nikita Hovratov commented on patch set 11 09/22/23, 08:57
AbstractFile.php:492ReplyThe information since which version the deprecation started is redunant. Usually we just state when the method / behavior will stop working. -
Thomas Hohn commented on patch set 11 09/22/23, 08:59
AbstractFile.php:492ReplyI have no problem with that - just found this example stating the opposite: 'ExtensionManagementUtility::addPageTSConfig() has been deprecated in TYPO3 v13.0 and will be removed in v14.0. Use Configuration/page.tsconfig files in extensions instead.', -
Nikita Hovratov commented on patch set 11 09/22/23, 09:11
AbstractFile.php:492ReplyIt's not consistent across the Core, yes. I just remember that we changed a bunch of deprecation messages in the past. Nothing that is set in stone, but keeping the messages short without redundant information is the preferred way. Remember: These will be found in the **deprecation** log. So stating this method or behavior is deprecated is already obvious. -
Nikita Hovratov commented on patch set 11 CR -1 09/22/23, 09:13
working on it. -
Thomas Hohn commented on patch set 11 09/22/23, 09:15
AbstractFile.php:492ReplySo change it to: Using the non-native enumeration TYPO3\CMS\Core\Resource\DuplicationBehavior will not work in TYPO3 v14.0 anymore. Use native TYPO3\CMS\Core\Resource\Enum\DuplicationBehavior instead. Or ?ClassNameMatcher.php:2354ReplyI should not resolve merge conflicts early in the morning ;-) -
Nikita Hovratov uploaded patch set 12
CR -1V +109/22/23, 09:56 -
Nikita Hovratov commented on patch set 12 09/22/23, 10:00
AbstractFile.php:492ReplyDoneClassNameMatcher.php:2354ReplyDone -
core-ci voted on patch set 12 V -1 09/22/23, 10:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47072
-
Nikita Hovratov commented on patch set 12 CR -1 09/22/23, 10:13
I'm really unsure here about the deprecation paired with changed parameter types. It will be very annoying for developers first to change everything to string|DuplicationBehavior in v13 and then immediately in v14 again to DuplicationBehavior. As we already know, that this signature change will happend, maybe we should postpone it to v14. This way, this patch shouldn't be breaking at all. Small exception: FileInterface->rename. We already changed the signature to string, but only on main! So we could revert it and postpone it until v14. I really think this is way better than having breaking changes for the same classes to times in a row. -
Thomas Hohn uploaded patch set 13
CR -1V -109/22/23, 10:15 -
Nikita Hovratov uploaded patch set 14 09/22/23, 10:17
-
core-ci voted on patch set 13 V +1 09/22/23, 10:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47075
-
Nikita Hovratov commented on patch set 14 09/22/23, 10:24
Sorry, I've overridden your patch Thomas. -
Nikita Hovratov commented on patch set 14 CR -1 09/22/23, 10:25
Read comment above. -
core-ci voted on patch set 14 V +1 09/22/23, 10:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47076
-
Thomas Hohn commented on patch set 14 09/22/23, 10:36
Reply
Just remind me why it's too late to have it with TYPO3 13 - without the deprecation? -
Thomas Hohn commented on patch set 14 10/12/23, 05:00
Reply
So you would make "another" patch with purpose is only to mark the class DuplicationBehavior as deprecated in TYPO3 13 and the remove it in TYPO3 14 together with the new signatures? -
Alexander Schnitzler commented on patch set 14 10/12/23, 06:04
Reply
Hi Nikita, it's almost three weeks now that you uploaded a patch set and stated you are unsure about something but didn't act. Do you expect Thomas to resolve your doubts? Please understand that those actions lead to frustration. By the size of this patch set I can very well guess how much time went into it and Thomas is been put on hold here by your -1, yet you don't express specific changes you want to see. You explained a way with a couple of maybe and should but it's not completely clear what exactly you want to do. Unless you want to remove your -1 I think it makes sense for you to upload a new patch set and bring this further so this patch can receive a +1 or +2 from you. But Please don't block (-1 and no action) this any further. -
Nikita Hovratov commented on patch set 14 10/12/23, 07:57
Reply
Hey, I was just waiting for approval of my proposal. I was writing with Thomas on Slack, so it seems here that I ignored him (sorry, should have communicated here as well) We need a pre-patch, which reverts the signature change of `FileInterface->rename`. This way, all method signatures of AbstractFile (rename, copyTo, etc.) won't be breaking in v13, while the deprecation is still logged. In v14 we change the signature to `DuplicationBehavior`. -
Alexander Schnitzler commented on patch set 14 10/12/23, 07:58
Reply
Thanks for the clarification. From just reading here it looked different. :) -
Thomas Hohn commented on patch set 14 10/12/23, 07:59
Reply
Hi - will have a look at it :) -
Nikita Hovratov commented on patch set 14 10/12/23, 08:13
Reply
Here is the patch: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81415 -
Nikita Hovratov uploaded patch set 15
CR -1V +110/12/23, 09:36 -
core-ci voted on patch set 15 V +1 10/12/23, 09:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47706
-
Benni Mack commented on patch set 15 10/12/23, 11:24
FileListController.php:673This method should return the Enum, in addition, I believe we could move this option directly to the Enum having a User object as argument. -
Thomas Hohn uploaded patch set 16
V +110/12/23, 13:49 -
Thomas Hohn commented on patch set 15 10/12/23, 13:50
Reply
DoneFileListController.php:673ReplyWill have a look into that -
Thomas Hohn commented on patch set 16 10/12/23, 13:50
Reply
Done -
Thomas Hohn commented on patch set 16 10/12/23, 13:57
FileListController.php:673ReplyWhat would you do about the logging? Have a DuplicationBehavior::NOTCONFIGURED and handle that here? -
core-ci voted on patch set 16 V -1 10/12/23, 13:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47722
-
Thomas Hohn uploaded patch set 17
V -110/12/23, 15:56 -
core-ci voted on patch set 17 V +1 10/12/23, 16:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47726
-
Thomas Hohn commented on patch set 17 10/12/23, 16:24
FileListController.php:673ReplyDone -
Nikita Hovratov commented on patch set 17 10/13/23, 08:54
Folder.php:285Please keep the doctype annoation `string|DuplicationBehavior`. This is useful for users and static code analysis.Folder.php:2891. Type Annotation for DuplicationBehavior should be removed here as well. 2. Let's remove the `string` annotations for localFilePath and fileName. This is a breaking change. -
Nikita Hovratov uploaded patch set 18
V +110/13/23, 08:54 -
core-ci voted on patch set 18 V +1 10/13/23, 09:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47735
-
Thomas Hohn uploaded patch set 19
V +110/13/23, 10:33 -
Thomas Hohn commented on patch set 19 10/13/23, 10:37
Folder.php:285ReplyDoneFolder.php:289ReplyDone -
core-ci voted on patch set 19 V +1 10/13/23, 10:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47736
-
Nikita Hovratov uploaded patch set 20
V +110/13/23, 13:49 -
core-ci voted on patch set 20 V +1 10/13/23, 13:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47741
-
Nikita Hovratov commented on patch set 20 V +1 CR +1 10/13/23, 13:58
This looks good now :) -
Christian Kuhn voted on patch set 20 CR +1 10/15/23, 13:52
-
Stefan Bürk commented on patch set 20 10/15/23, 14:11
Feature-101151-DuplicationBehavior.rst:24Should we not make that a bullet list ? (Missing `*` for each line ...
-
Thomas Hohn uploaded patch set 21
CR +1V +110/15/23, 16:54 -
Thomas Hohn commented on patch set 21 10/15/23, 16:54
Feature-101151-DuplicationBehavior.rst:24ReplyDone -
core-ci voted on patch set 21 V +1 10/15/23, 17:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47784
-
Nikita Hovratov voted on patch set 21 V +1 CR +1 10/16/23, 07:36
-
Chris Müller commented on patch set 21 10/16/23, 08:23
Deprecation-101151-DuplicationBehaviorClass.rst:37Shouldn't this be \TYPO3\CMS\Core\Resource\Enum\DuplicationBehavior? -
Nikita Hovratov uploaded patch set 22
CR +1V +110/16/23, 08:51 -
Nikita Hovratov commented on patch set 22 10/16/23, 08:52
Deprecation-101151-DuplicationBehaviorClass.rst:37ReplyYes, thanks. The other namespace was also wrong. Fixed now. -
core-ci voted on patch set 22 V +1 10/16/23, 08:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47807
-
Nikita Hovratov voted on patch set 22 V +1 CR +1 10/18/23, 07:13
-
Thomas Hohn uploaded patch set 23
CR +1V +110/23/23, 08:41 -
core-ci voted on patch set 23 V -1 10/23/23, 08:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48073
-
Thomas Hohn uploaded patch set 24
V -110/23/23, 09:07 -
core-ci voted on patch set 24 V +1 10/23/23, 09:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48076
-
Nikita Hovratov voted on patch set 24 V +1 CR +1 10/23/23, 10:55
-
Andreas Kienast commented on patch set 24 10/26/23, 13:01
AbstractFile.php:483I'd rather use `DuplicationBehavior::class` instead.DuplicationBehavior.php:56`self::CANCEL`DuplicationBehavior.php:64`self::tryFrom()`DuplicationBehavior.php:76`self::CANCEL`Folder.php:295I'd rather use `DuplicationBehavior::class` instead.ResourceStorage.php:1241I'd rather use `DuplicationBehavior::class` instead. -
Nikita Hovratov uploaded patch set 25
CR +1V +110/26/23, 13:17 -
Nikita Hovratov commented on patch set 25 10/26/23, 13:17
DuplicationBehavior.php:56ReplyDoneDuplicationBehavior.php:64ReplyDoneDuplicationBehavior.php:76ReplyDone -
Nikita Hovratov commented on patch set 25 10/26/23, 13:21
AbstractFile.php:483ReplyLet's keep it as is please, there is no benefit in changing it to DuplicationBehavior::class. It won't change ever and will be removed in v13 regardless. -
Nikita Hovratov commented on patch set 25 10/26/23, 13:21
AbstractFile.php:483Replyv14* -
core-ci voted on patch set 25 V +1 10/26/23, 13:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48236
-
Thomas Hohn commented on patch set 25 10/27/23, 04:18
AbstractFile.php:483ReplyDone -
Thomas Hohn commented on patch set 25 10/27/23, 04:18
Folder.php:295ReplyDoneResourceStorage.php:1241ReplyDone -
Andreas Kienast voted on patch set 25 V +1 CR +1 10/27/23, 08:01
-
Nikita Hovratov voted on patch set 25 V +2 CR +2 10/27/23, 08:14
-
Nikita Hovratov merged patch set 26 10/27/23, 08:15
DuplicationBehavior.php:3