Merge branch 'master' into next
authorMatthias Schmidt <gravatronics@live.com>
Sun, 21 Aug 2016 13:42:08 +0000 (15:42 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 21 Aug 2016 13:42:08 +0000 (15:42 +0200)
# Conflicts:
#
wcfsetup/install/files/lib/system/cronjob/UserGroupAssignmentCronjob.cla
ss.php

1  2 
wcfsetup/install/files/lib/system/cronjob/UserGroupAssignmentCronjob.class.php

index 9044b7872498c45937b3efd5a369f68f415ebc65,d8bc124561c56133b39d52424c917402748ce907..3c0d0d0d167fadb0dcf862cc0b7f198148af4116
@@@ -31,12 -33,14 +31,14 @@@ class UserGroupAssignmentCronjob extend
                }
                
                foreach ($usersToGroup as $groupID => $users) {
-                       $userAction = new UserAction(array_unique($users), 'addToGroups', [
-                               'addDefaultGroups' => false,
-                               'deleteOldGroups' => false,
-                               'groups' => [$groupID]
-                       ]);
-                       $userAction->executeAction();
+                       if (!empty($users)) {
 -                              $userAction = new UserAction(array_unique($users), 'addToGroups', array(
++                              $userAction = new UserAction(array_unique($users), 'addToGroups', [
+                                       'addDefaultGroups' => false,
+                                       'deleteOldGroups' => false,
 -                                      'groups' => array($groupID)
 -                              ));
++                                      'groups' => [$groupID]
++                              ]);
+                               $userAction->executeAction();
+                       }
                }
        }
  }