79516[!!!][TASK] Convert VersionState to backed enum
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Oliver Hader +1
-
Verified V +2 Done
- Benni Mack +2
- Oliver Hader +1
Issues 1
Files 39
- typo3/sysext/backend/Classes/ContextMenu/ItemProviders/RecordProvider.php3+1 −4
- typo3/sysext/backend/Classes/Controller/Page/LocalizationController.php+1 −1
- typo3/sysext/backend/Classes/Controller/EditDocumentController.php2+3 −3
- typo3/sysext/backend/Classes/Controller/PageLayoutController.php+1 −1
- typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php+2 −2
- typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseEditRow.php2+1 −2
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaFiles.php+2 −2
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInline.php+2 −2
- typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php2+1 −2
- typo3/sysext/backend/Classes/Tree/Repository/PageTreeRepository.php2+8 −7
- typo3/sysext/backend/Classes/Utility/BackendUtility.php5+16 −16
- typo3/sysext/backend/Classes/View/BackendLayout/Grid/LanguageColumn.php3+1 −1
- typo3/sysext/backend/Classes/View/BackendLayout/ContentFetcher.php+1 −1
- typo3/sysext/core/Classes/Database/Query/Restriction/WorkspaceRestriction.php+2 −2
- typo3/sysext/core/Classes/Database/RelationHandler.php+1 −1
- typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php+1 −1
- typo3/sysext/core/Classes/DataHandling/DataHandler.php5+18 −18
- typo3/sysext/core/Classes/DataHandling/PlainDataResolver.php+2 −2
- typo3/sysext/core/Classes/DataHandling/SlugHelper.php+2 −2
- typo3/sysext/core/Classes/Domain/Repository/PageRepository.php6+14 −16
Show 19 more files
- typo3/sysext/core/Classes/Imaging/IconFactory.php+1 −2
- typo3/sysext/core/Classes/Utility/RootlineUtility.php+2 −2
- typo3/sysext/core/Classes/Versioning/VersionState.php2+33 −12
- typo3/sysext/core/Documentation/Changelog/13.0/Breaking-101175-ConvertVersionStateToNativeEnum.rstnew+62 −0
- typo3/sysext/core/Documentation/Changelog/13.0/Deprecation-101175-VersionState.rstnew+48 −0
- typo3/sysext/core/Tests/Functional/Domain/Repository/PageRepositoryTest.php+2 −2
- typo3/sysext/core/Tests/UnitDeprecated/Versioning/VersionStateTest.phpnew+71 −0
- typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php+1 −1
- typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php+1 −1
- typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php2+7 −0
- typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php+7 −0
- typo3/sysext/workspaces/Classes/Controller/Remote/RemoteServer.php2+3 −3
- typo3/sysext/workspaces/Classes/Controller/ReviewController.php+1 −1
- typo3/sysext/workspaces/Classes/Dependency/ElementEntityProcessor.php+2 −2
- typo3/sysext/workspaces/Classes/EventListener/PageTreeItemsHighlighter.php+1 −1
- typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php2+21 −21
- typo3/sysext/workspaces/Classes/Service/GridDataService.php4+3 −2
- typo3/sysext/workspaces/Classes/Service/IntegrityService.php+1 −1
- typo3/sysext/workspaces/Classes/Service/WorkspaceService.php+8 −8
Review log 3345
Show 1520 earlier messages
-
Thomas Hohn uploaded patch set 1 06/27/23, 09:10
-
core-ci voted on patch set 1 V -1 06/27/23, 09:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43014
-
Thomas Hohn uploaded patch set 2
V -106/27/23, 09:27 -
Mathias Brodala commented on patch set 2 06/27/23, 09:31
PageTreeRepository.php:280See above.BackendUtility.php:1139Looks like this could be skipped since it merely converts "null" to "0", not making a difference in this switch. -
core-ci voted on patch set 2 V +1 06/27/23, 09:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43016
-
Thomas Hohn commented on patch set 2 06/27/23, 09:43
BackendUtility.php:1139ReplyThe signature for tryFrom is either int or int|string so I wanted to ensure that there is no type errors -
Mathias Brodala commented on patch set 2 06/27/23, 09:46
BackendUtility.php:1139ReplySure, but then you'd use this: VersionState::tryFrom($row['t3ver_state'] ?? 0) -> use column value or "0" if missing/null -
Thomas Hohn commented on patch set 2 06/27/23, 09:48
BackendUtility.php:1139ReplyI was blind - sorry 😊 -
Benni Mack commented on patch set 2 06/27/23, 11:06
GridDataService.php:184I would also go with comparing 2 enums instead of the int compare -
Thomas Hohn uploaded patch set 3
V +106/28/23, 05:04 -
Thomas Hohn commented on patch set 2 06/28/23, 05:05
EditDocumentController.php:2217ReplyDonePageTreeRepository.php:280ReplyDoneBackendUtility.php:1139ReplyDoneGridDataService.php:184ReplyDone -
core-ci voted on patch set 3 V +1 06/28/23, 05:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43055
-
Oliver Hader commented on patch set 3 06/28/23, 06:10
RecordProvider.php:590`?? 0`DatabaseEditRow.php:52`?? 0`DatabaseRecordList.php:2075`?? 0`LanguageColumn.php:143`!== VersionState::DELETE_PLACEHOLDER`DataHandler.php:8077What about changing to `VersionState::tryFrom($row['t3ver_state'] ?? 0) !== VersionState::MOVE_POINTER`?VersionState.php:21For backward compatibility it even would be possible to keep the methods `equals` and `cast` and throw corresponding deprecation messages - not a requirement, just something to think about.RemoteServer.php:130`===` -
Thomas Hohn commented on patch set 3 06/28/23, 06:59
LanguageColumn.php:143ReplyNice catch 😊DataHandler.php:8077ReplyMust have slipped through :-) -
Thomas Hohn commented on patch set 3 06/28/23, 07:00
RecordProvider.php:590ReplyThere is a check in L587 that could be removed in favour of the ?? 0 -
Thomas Hohn uploaded patch set 4
V +106/28/23, 07:24 -
Thomas Hohn commented on patch set 4 06/28/23, 07:25
RecordProvider.php:590ReplyDoneDatabaseEditRow.php:52ReplyDoneDatabaseRecordList.php:2075ReplyDoneLanguageColumn.php:143ReplyDoneDataHandler.php:8077ReplyDoneRemoteServer.php:130ReplyDone -
core-ci voted on patch set 4 V +1 06/28/23, 07:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43062
-
Thomas Hohn uploaded patch set 5
V +106/28/23, 08:46 -
core-ci voted on patch set 5 V -1 06/28/23, 08:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43065
-
Thomas Hohn uploaded patch set 6
V -106/28/23, 08:57 -
core-ci voted on patch set 6 V +1 06/28/23, 09:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43066
-
Thomas Hohn commented on patch set 6 06/28/23, 09:25
VersionState.php:21ReplyDone -
Benni Mack commented on patch set 6 07/04/23, 10:25
minor feedback, but really good improvement! This will also speed up TYPO3 massively due to the fact that Enums are singletonsDataHandler.php:3843let's use Enum comparison here as wellPageRepository.php:1623let's use enum check as well herePageRepository.php:1638?? VersionState::DEFAULT_STATE is not needed here. We use tryFrom()PageRepository.php:1670we can remove the type annotation hereMethodCallMatcher.php:5801method is called "equals" not "equal"DataHandlerHook.php:223we don't need the fallback to the DefaultState hereGridDataService.php:591let's use tryFrom($stateId) and we compare the enums in the switch case directly -
Thomas Hohn uploaded patch set 7
V +107/04/23, 11:06 -
Thomas Hohn commented on patch set 7 07/04/23, 11:07
DataHandler.php:3843ReplyDonePageRepository.php:1623ReplyDonePageRepository.php:1638ReplyDonePageRepository.php:1670ReplyDoneMethodCallMatcher.php:5801ReplyDoneDataHandlerHook.php:223ReplyDoneGridDataService.php:591ReplyDone -
core-ci voted on patch set 7 V +1 07/04/23, 11:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43371
-
Benni Mack uploaded patch set 8
V +107/04/23, 21:03 -
Benni Mack voted on patch set 8 V +1 CR +1 07/04/23, 21:03
-
core-ci voted on patch set 8 V +1 07/04/23, 21:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43442
-
Benni Mack commented on patch set 8 CR -1 07/05/23, 07:20
needs further work on the actual new Enum -
Benni Mack uploaded patch set 9
CR -1V +107/05/23, 07:26 -
core-ci voted on patch set 9 V -1 07/05/23, 07:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43462
-
Benni Mack commented on patch set 10
V -107/05/23, 09:06Published edit on patch set 9. -
core-ci voted on patch set 10 V -1 07/05/23, 09:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43477
-
Benni Mack uploaded patch set 11
V -107/05/23, 10:47 -
core-ci voted on patch set 11 V +1 07/05/23, 10:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43487
-
Oliver Hader commented on patch set 11 07/05/23, 13:45
on it... -
Benni Mack voted on patch set 11 V +1 CR +1 07/05/23, 13:46
-
Oliver Hader uploaded patch set 12
CR +1V +107/05/23, 14:34 -
Oliver Hader uploaded patch set 13 07/05/23, 14:37
-
Oliver Hader voted on patch set 13 V +1 CR +1 07/05/23, 14:38
-
Benni Mack voted on patch set 13 V +2 CR +2 07/05/23, 14:49
-
Benni Mack merged patch set 14 07/05/23, 14:49
-
core-ci voted on patch set 12 V +1 07/05/23, 14:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43534
EditDocumentController.php:2217