From 9f4e72b48622eb1a49ee156c1145f95fb19ba87b Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 30 Jul 2013 14:09:38 +0200 Subject: [PATCH] Fixed import issues --- .../lib/system/importer/UserImporter.class.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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(); -- 2.20.1