Fixed import issue
authorMarcel Werk <burntime@woltlab.com>
Sat, 20 Jul 2013 20:37:11 +0000 (22:37 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sat, 20 Jul 2013 20:37:11 +0000 (22:37 +0200)
wcfsetup/install/files/lib/system/importer/UserGroupImporter.class.php

index 46b72280691e8802fa5de90415edf24d1072e625..8d657e6c704b4cdd78da136039786217956d6e7f 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\importer;
+use wcf\data\user\group\UserGroup;
 use wcf\data\user\group\UserGroupAction;
 
 /**
@@ -17,11 +18,16 @@ class UserGroupImporter implements IImporter {
         * @see wcf\system\importer\IImporter::import()
         */
        public function import($oldID, array $data, array $additionalData = array()) {
-               $action = new UserGroupAction(array(), 'create', array(
-                       'data' => $data         
-               ));
-               $returnValues = $action->executeAction();
-               $newGroupID = $returnValues['returnValues']->groupID;
+               if ($data['groupType'] < 4) {
+                       $newGroupID = UserGroup::getGroupByType($data['groupType'])->groupID;
+               }
+               else {
+                       $action = new UserGroupAction(array(), 'create', array(
+                               'data' => $data         
+                       ));
+                       $returnValues = $action->executeAction();
+                       $newGroupID = $returnValues['returnValues']->groupID;
+               }
                
                ImportHandler::getInstance()->saveNewID('com.woltlab.wcf.user.group', $oldID, $newGroupID);