From: Marcel Werk Date: Tue, 30 Jul 2013 12:09:38 +0000 (+0200) Subject: Fixed import issues X-Git-Tag: 2.0.0_Beta_6~9^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9f4e72b48622eb1a49ee156c1145f95fb19ba87b;p=GitHub%2FWoltLab%2FWCF.git Fixed import issues --- diff --git a/wcfsetup/install/files/lib/system/importer/UserImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserImporter.class.php index e2d0b9fcfa..e83b8e3561 100644 --- a/wcfsetup/install/files/lib/system/importer/UserImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserImporter.class.php @@ -3,6 +3,7 @@ namespace wcf\system\importer; use wcf\data\user\User; use wcf\data\user\UserAction; use wcf\system\database\DatabaseException; +use wcf\system\language\LanguageFactory; use wcf\system\WCF; use wcf\util\StringUtil; @@ -32,7 +33,7 @@ class UserImporter implements IImporter { // merge user ImportHandler::getInstance()->saveNewID('com.woltlab.wcf.user', $oldID, $existingUser->userID); - return $existingUser->userID; + return 0; } } @@ -64,11 +65,21 @@ class UserImporter implements IImporter { } } + // handle languages + $languageIDs = array(); + if (isset($additionalData['languages'])) { + foreach ($additionalData['languages'] as $languageCode) { + $language = LanguageFactory::getInstance()->getLanguageByCode($languageCode); + if ($language !== null) $languageIDs[] = $language->languageID; + } + } + // create user $action = new UserAction(array(), 'create', array( 'data' => $data, 'groups' => $groupIDs, - 'options' => $userOptions + 'options' => $userOptions, + 'languages' => $languageIDs )); $returnValues = $action->executeAction();