[BUGFIX] usergroup field is required if allowUserGroupSelection is set 80/58680/2
authorStanislas Rolland <typo3@sjbr.ca>
Wed, 24 Oct 2018 02:54:51 +0000 (22:54 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Wed, 24 Oct 2018 02:56:18 +0000 (04:56 +0200)
This usergroup field should not be necessarily required in such case.

Resolves: #86726
Change-Id: Ied9aa07035a21f3c4309361892c9c9782f2c1f8e
Reviewed-on: https://review.typo3.org/58680
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
ChangeLog
Classes/Hooks/UsergroupHooks.php

index 4c4cced..f30a3b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
        * Resolves #85925: PHP codeinspection returns errors
        * Resolves #84694: Backslash missing in user image preview link path
        * Resolves #84569: Misleading frontend output while deleting images in EDIT mode
+       * Resolves #86726: usergroup field is required when allowUserGroupSelection is set
 
 2018-04-04 Stanislas Rolland  <typo3(arobas)sjbr.ca>
        * Resolves #84605: PHP Warning: count() in SJBR\SrFeuserRegister\Request\Parameters
index 2df299e..02d3908 100644 (file)
@@ -40,12 +40,11 @@ class UsergroupHooks
         */
        public function modifyConf(array &$conf, $cmdKey)
        {
-               // Add usergroup to the list of fields and required fields if the user is allowed to select user groups
+               // Add usergroup to the list of fields if the user is allowed to select user groups
                // Except when only updating password
                if ($cmdKey !== 'password') {
                        if ($conf[$cmdKey . '.']['allowUserGroupSelection']) {
                                $conf[$cmdKey . '.']['fields'] = implode(',', array_unique(GeneralUtility::trimExplode(',', $conf[$cmdKey . '.']['fields'] . ',usergroup', true)));
-                               $conf[$cmdKey . '.']['required'] = implode(',', array_unique(GeneralUtility::trimExplode(',', $conf[$cmdKey . '.']['required'] . ',usergroup', true)));
                        } else {
                                // Remove usergroup from the list of fields and required fields if the user is not allowed to select user groups
                                $conf[$cmdKey . '.']['fields'] = implode(',', array_diff(GeneralUtility::trimExplode(',', $conf[$cmdKey . '.']['fields'], true), array('usergroup')));