85586[BUGFIX] Replace method returnWebmounts() with getWebmounts()
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Garvin Hicking +1
- Andreas Kienast +1
-
Verified V +2 Done
- Christian Kuhn +2
- Andreas Kienast +1
- core-ci +1 CI
Issues 2
Files 10
- typo3/sysext/backend/Classes/ContextMenu/ItemProviders/PageProvider.php+1 −1
- typo3/sysext/backend/Classes/Controller/Page/TreeController.php3+2 −2
- typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php+1 −1
- typo3/sysext/backend/Classes/Search/LiveSearch/DatabaseRecordProvider.php+1 −1
- typo3/sysext/backend/Classes/Search/LiveSearch/PageRecordProvider.php+1 −1
- typo3/sysext/backend/Classes/Utility/BackendUtility.php+1 −1
- typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php8+17 −2
- typo3/sysext/core/Tests/Functional/Authentication/BackendUserAuthenticationTest.php3+12 −0
- typo3/sysext/lowlevel/Classes/Controller/DatabaseIntegrityController.php+3 −3
- typo3/sysext/workspaces/Classes/Service/WorkspaceService.php+2 −2
Review log 3848
Show 1823 earlier messages
-
Thomas Hohn uploaded patch set 1 08/12/24, 08:04
-
Thomas Hohn updated the commit message in patch set 2 08/12/24, 08:09
-
core-ci voted on patch set 2 V +1 08/12/24, 08:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63206
-
Thomas Hohn commented on patch set 2 08/12/24, 08:21
Hi - add you since you added types to getTreeList ;-) -
Andreas Kienast commented on patch set 2 08/12/24, 08:22
Why can't we return a sanitized result from `returnWebmounts()`? That would be the proper solution to me. -
Thomas Hohn commented on patch set 2 08/12/24, 08:29
Reply
I guess this would be a breaking change since it's available via $GLOBALS['BE_USER']->returnWebmounts(). The method is public in BackendUserAuthentication. I can make an issue for TYPO3 14 to clean it up -
Ayke Halder updated the commit message in patch set 3
V +108/12/24, 08:43 -
core-ci voted on patch set 3 V +1 08/12/24, 08:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63208
-
Andreas Kienast commented on patch set 3 08/12/24, 10:08
Reply
Done -
Thomas Hohn uploaded patch set 4
V +108/12/24, 12:22 -
core-ci voted on patch set 4 V +1 08/12/24, 12:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63226
-
Andreas Kienast commented on patch set 4 08/12/24, 12:35
BackendUserAuthentication.php:907`GeneralUtility::intExplode()` might be suitable here. -
Thomas Hohn uploaded patch set 5
V +108/12/24, 12:46 -
Andreas Kienast commented on patch set 5 08/12/24, 12:51
BackendUserAuthentication.php:901Why do we need to wait for v14? Adding this now isn't breaking.BackendUserAuthentication.php:907ReplyDone -
core-ci voted on patch set 5 V +1 08/12/24, 12:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63232
-
Thomas Hohn uploaded patch set 6
V +108/12/24, 13:00 -
core-ci voted on patch set 6 V +1 08/12/24, 13:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63237
-
Thomas Hohn commented on patch set 6 08/12/24, 13:17
BackendUserAuthentication.php:901ReplyFine with me then ;-) -
Andreas Kienast voted on patch set 6 CR +1 08/12/24, 13:40
-
Benni Mack voted on patch set 6 CR +1 08/12/24, 18:17
-
Garvin Hicking commented on patch set 6 08/12/24, 20:36
I hope I'm not blaming myself (again), it's still warm here: `isWebMount()` of `typo3/sysext/backend/Classes/ContextMenu/ItemProviders/PageProvider.php` does this: ``` return in_array($this->identifier, $this->backendUser->returnWebmounts()); ``` and `$this->identifier` according to `typo3/sysext/backend/Classes/ContextMenu/ItemProviders/AbstractProvider.php` says "clicked record identifier (usually uid or file combined identifier)". That "combined identifier" makes me stumble. Is there a way that a string could be (validly) be passed by this and might lead to being cast as an invalid integer then? BTW: In the TYPO3 code search I found 5 public extensions (pagetreefilter, news, calendarize, ai_suite, address) that use `returnWebMounts`. Most of them alread use array_map() on their own, and those that do not should not face a regression with getting an int at least. -
Thomas Hohn commented on patch set 6 08/13/24, 04:40
Reply
Hi @gh@faktor-e.de So I believe the $this->identifier should and must be a uid in the PageProvider case - I can't see why it work otherwise. Assuming that the mount points are uid's I see no case where the provided patch should change that behaviour. The class FileProvider also extends the AbstractProvider and I believe that in that case the identifier could be a combined identifier - but I see no reason why this patch affects that case - since the comparison is done in the PageProvider class. -
Thomas Hohn updated the commit message in patch set 7
CR +1V +108/13/24, 06:09
-
core-ci voted on patch set 7 V +1 08/13/24, 06:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63277
-
Andreas Kienast commented on patch set 7 08/13/24, 06:55
TreeController.php:524I just noticed we have subsequent calls to `array_unique()` quite often. Do you think it makes sense to incorporate this in `returnWebmounts()` as well? -
Oliver Hader commented on patch set 7 08/13/24, 07:05
Why not just fixing this in `\TYPO3\CMS\Lowlevel\Controller\DatabaseIntegrityController::getSelectQuery`? The chances are high, that changing the return type of `$beUser->returnWebmounts()` would break other individual implementations. We could introduce a new `getWebmounts()` returning `list<int>` (and optionally deprecate the existing `returnWebmounts()`). -
Thomas Hohn commented on patch set 7 08/13/24, 07:06
TreeController.php:524ReplyHi - I think we should make a follow up issue fixing that, since it might require an more in depth analysis of that. -
Oliver Hader commented on patch set 7 CR -1 08/13/24, 07:06
I'm rather -1 on the change, since it might have negative side effects... -
Thomas Hohn commented on patch set 7 08/13/24, 07:16
Reply
I think the correct fix is to fix returnWebmounts. I have no problem in introducing a new method getWebmounts and keep returnWebmounts. I think a follow up issue could deprecate and fix the array_unique() issue -
Thomas Hohn uploaded patch set 8
CR -1V +108/13/24, 07:46 -
core-ci voted on patch set 8 V +1 08/13/24, 07:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63278
-
Thomas Hohn commented on patch set 8 08/13/24, 07:51
Reply
Hi - did as proposed at created a follow up issue #104607 for deprecating the returnWebmounts methodTreeController.php:524ReplyCreate the follow up issue #104607 -
Oliver Klee commented on patch set 8 08/13/24, 09:14
BackendUserAuthentication.php:900We can make the return type more explicit here: ``` @return list<numeric-string> ```BackendUserAuthentication.php:915We can be even more specific: ``` @return list<int> ``` -
Thomas Hohn uploaded patch set 9
V +108/13/24, 09:25 -
Thomas Hohn commented on patch set 9 08/13/24, 09:25
Reply
DoneBackendUserAuthentication.php:900ReplyDoneBackendUserAuthentication.php:915ReplyDone -
core-ci voted on patch set 9 V +1 08/13/24, 09:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63285
-
Oliver Klee commented on patch set 9 08/13/24, 10:36
BackendUserAuthenticationTest.php:71Please let's duplicate this test (and rename it accordingly) instead of changing it. That way, we can have tests for both methods. -
Thomas Hohn commented on patch set 9 08/13/24, 10:57
BackendUserAuthenticationTest.php:71ReplyAcknowledged -
Thomas Hohn uploaded patch set 10
V +108/13/24, 11:12 -
Thomas Hohn commented on patch set 9 08/13/24, 11:12
BackendUserAuthenticationTest.php:71ReplyDone -
core-ci voted on patch set 10 V +1 08/13/24, 11:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63303
-
Christian Kuhn uploaded patch set 11
V +108/13/24, 11:32 -
Christian Kuhn voted on patch set 11 CR +1 V +1 08/13/24, 11:32
-
Andreas Kienast voted on patch set 11 CR +1 V +1 08/13/24, 11:34
-
Christian Kuhn commented on patch set 11 CR +2 V +2 08/13/24, 11:34
preparing backport. -
core-ci voted on patch set 11 V +1 08/13/24, 11:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63304
-
Garvin Hicking commented on patch set 11 CR +1 08/13/24, 11:53
I like how this evolved, thanks! -
Christian Kuhn merged patch set 12 08/13/24, 11:55