Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.
84995[FEATURE] Allow assigning users to groups in group editor
Commit message
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 11
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/95/84995/11 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/95/84995/11 && git cherry-pick FETCH_HEAD
Review
-
Code review CR -1 Needs a vote
- Andreas Kienast -1
-
Verified V +1 Needs a vote
- Guido Schmechel +1
- core-ci +1 CI
Issues 1
Files 13
- Build/Sources/TypeScript/backend/form-engine/element/select-group-users-element.ts2new+272 −0
- typo3/sysext/backend/Classes/Controller/FormSelectGroupUsersAjaxController.php8new+132 −0
- typo3/sysext/backend/Classes/Form/Element/SelectGroupUsersElement.php5new+57 −0
- typo3/sysext/backend/Classes/Form/FormDataGroup/TcaSelectGroupUsersAjaxFieldData.php2new+41 −0
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectGroupUsers.php5new+177 −0
- typo3/sysext/backend/Classes/Form/NodeFactory.php+1 −0
- typo3/sysext/backend/Configuration/Backend/AjaxRoutes.php+17 −0
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine/element/select-group-users-element.jsnew+97 −0
- typo3/sysext/beuser/Resources/Private/Language/locallang.xlf+21 −0
- typo3/sysext/core/Configuration/TCA/be_groups.php+9 −1
- typo3/sysext/core/Configuration/DefaultConfiguration.php+66 −0
- typo3/sysext/core/Documentation/Changelog/13.3/Feature-103758-AllowAssigningUsersDirectlyToTheBackendGroupFromTheGroupSettings.rstnew+29 −0
- typo3/sysext/core/Resources/Private/Language/locallang_tca.xlf+3 −0
Review log 2435
Show 610 earlier messages
-
Krzysztof Gutkowski uploaded patch set 1 06/28/24, 13:13
-
core-ci voted on patch set 1 V -1 06/28/24, 13:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60563
-
Marcin Sągol uploaded patch set 2
V -106/30/24, 19:37 -
core-ci voted on patch set 2 V -1 06/30/24, 19:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60707
-
Marcin Sągol uploaded patch set 3
V -106/30/24, 20:11 -
core-ci voted on patch set 3 V -1 06/30/24, 20:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60708
-
Marcin Sągol uploaded patch set 4
V -106/30/24, 20:19 -
core-ci voted on patch set 4 V +1 06/30/24, 20:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60709
-
Mogens Fiebrandt commented on patch set 4 CR -1 06/30/24, 23:35
Nice feature. Would love to have this.select-group-users-element.ts:161It's possible to add backend-user and admin-user to a group. You should consider to render the correct icon for the user here.TcaSelectGroupUsersAjaxFieldData.php:32The functions return type declaration is missing here.TcaSelectGroupUsers.php:52I think there is no need to iterate over all columns of the be_group table. You already know, that you are looking for the fieldname "users" here.TcaSelectGroupUsers.php:119The default value for itemsPerPage is set in the TCA of be_groups. If not set, an undefined array key warning exception is thrown in line 64. Maybe it would be better to check the default value ealier in your code and if not set, then set it to 5 like the default value in the TCA of the be_groups. -
Marcin Sągol uploaded patch set 5
CR -1V +107/01/24, 08:53
-
Marcin Sągol commented on patch set 5 07/01/24, 08:54
select-group-users-element.ts:161ReplyDoneTcaSelectGroupUsersAjaxFieldData.php:32ReplyDoneTcaSelectGroupUsers.php:52Reply@mogens.fiebrandt@googlemail.com here we are following convention how all other data providers checks if handle given field type and process the data for it.TcaSelectGroupUsers.php:119ReplyDone -
core-ci voted on patch set 5 V +1 07/01/24, 09:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60743
-
Mogens Fiebrandt commented on patch set 5 CR -1 07/01/24, 09:23
TcaSelectGroupUsers.php:52Reply@marcin@soee.pl i would say your case is different from the other cases. Because you're fetching sensible data here. You already nailed the database in the data-provider. Maybe it would also be good to nail the field. Not sure if this else could become an sec issue somehow. Maybe someone from the security team could mention his thoughts to that. -
Marcin Sągol uploaded patch set 6
CR -1V +107/01/24, 09:56 -
core-ci voted on patch set 6 V +1 07/01/24, 10:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60760
-
Tymoteusz Motylewski commented on patch set 6 07/09/24, 08:17
just main. no need to target 13.2 -
Krzysztof Gutkowski uploaded patch set 7
V +107/10/24, 08:42 -
core-ci voted on patch set 7 V +1 07/10/24, 08:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61298
-
Tymoteusz Motylewski commented on patch set 7 09/02/24, 10:34
Reply
Done -
Guido Schmechel commented on patch set 7 09/02/24, 15:41
Feature RST can be moved to 13.3 folder -
Oskar Dydo uploaded patch set 8
V +109/04/24, 13:10 -
core-ci voted on patch set 8 V +1 09/04/24, 13:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64756
-
Guido Schmechel commented on patch set 8 09/07/24, 16:09
Basically, the feature works for me. But does it still make sense to restrict the new TCA type selectGroupUsers? Simply to avoid misunderstandings. -
Oskar Dydo uploaded patch set 9
V +109/13/24, 09:26 -
core-ci voted on patch set 9 V +1 09/13/24, 09:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65645
-
Oskar Dydo rebased onto patch set 10
V +109/13/24, 10:14 -
core-ci voted on patch set 10 V +1 09/13/24, 10:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65655
-
Markus Klein updated the commit message in patch set 11
V +109/13/24, 10:44 -
core-ci voted on patch set 11 V +1 09/13/24, 10:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65663
-
Guido Schmechel voted on patch set 11 V +1 09/13/24, 14:51
-
Stefan Bürk commented on patch set 11 09/14/24, 00:30
Thanks for the work and providing this change. Not a full review yet, just played around with it in the backend. * editing a backend user group and adding/deleting a user from the group does this directly using ajax, which feels kind if counter-intuitive. For example a user is added or deleted, the modal closed and "closing" the group edit form a) does not ask for change/discard changes and reoping has the user added/deleted. In a form having a close/question-todiscard + explicitly safe logic that feels somehow wrong. * the record listing in the modal is not shown by default, and even searching does not listen the records - the collapsible state is here also counter intuitive * usually in modals, we have two ways - select a single item and close modal with one clikc (link chain in linkbrowser for example or other add modals) and a plus-sign selecting one without closing the modal. Not sure about the user experiance here - needs a look from more experianced people in that area.FormSelectGroupUsersAjaxController.php:30Add following phpdoc block ```php /** * @internal This class is a specific Backend controller implementation and is not considered part of the Public TYPO3 API. */ ```SelectGroupUsersElement.php:21Unresolvedcommit message mentiones that this field is for internal use only. Let's add a @internal annotation to emphasize this. ```php /** * @internal This class is a specific Backend formengine implementation for a concreate use-case and is not considered part of the Public TYPO3 API. */ ``` On top of that I guess we should not document it - otherwise people want to use it. -
Stefan Bürk commented on patch set 11 09/14/24, 00:51
Reply Unresolved
Resolving these issues I'd postulate that a more generic type can be implemented in v14 so it can be used for similar relation but in a flexible way.FormSelectGroupUsersAjaxController.php:30Reply UnresolvedAdditional we should consider to make the class final ....FormSelectGroupUsersAjaxController.php:37UnresolvedThis action should throw an exception when current backend user is not a admin.FormSelectGroupUsersAjaxController.php:103UnresolvedThis action should throw an exception when current backend user is not a admin.FormSelectGroupUsersAjaxController.php:105UnresolvedLet the connectionpool be injected, and create the QueryBuilder than from the retrieved service: ``` $queryBuilder = $this->connectionPool->getQueryBuilderForTable(); ```FormSelectGroupUsersAjaxController.php:110UnresolvedPlease use here ``` $queryBuilder->createNamedPlaceholder(...) ``` and drop the `setParameter()` call below.FormSelectGroupUsersAjaxController.php:111Unresolvedadd ``` ->setMaxResults(1) ``` here - granted, with uid only one record should be retrieved, but explicitly set the max results makes it clear that only one record is retrieved (and ensured that the resultset is properly closed and buffer cleared). Mainly because `fetchOne()` will only return the first column of the first row.FormSelectGroupUsersAjaxController.php:115UnresolvedPlease set the 3rd argument to true so empty values will not resolve to `0` during int casts and dropped.SelectGroupUsersElement.php:25UnresolvedI'd say we should check the tablename `be_groups` and throw otherwise an `\RuntimeException`, so no one uses this type for other things as this can introduce information disclosures. Maybe also by making the class final to make it harder to missuse this implementation. -
Andreas Kienast commented on patch set 11 CR -1 09/16/24, 08:59
SelectGroupUsersElement.php:36There's a whitespace missing at the end, otherwise the rendered output is ``` <typo3-backend-form-selectgroupuserscurrentGroup="XXX".../> ``` Also, web component CANNOT be self-closing. -
Marcin Sągol commented on patch set 11 08/08/26, 17:36
SelectGroupUsersElement.php:36ReplyI am working on a completely different approach to this whoel feature. Will post the updated code soon. -
Benni Mack commented on patch set 11 11/10/26, 13:38
SelectGroupUsersElement.php:36Reply Unresolvedany update? Or is it going to be a new patch?