$data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
$contents = [];
- foreach ($additionalData['contents'] as $languageCode => $contentData) {
- $languageID = 0;
- if (!$languageCode) {
- if (($language = LanguageFactory::getInstance()->getLanguageByCode($languageCode)) !== null) {
- $languageID = $language->languageID;
- }
- else {
- continue;
+ if (!empty($additionalData['contents'])) {
+ foreach ($additionalData['contents'] as $languageCode => $contentData) {
+ $languageID = 0;
+ if (!$languageCode) {
+ if (($language = LanguageFactory::getInstance()->getLanguageByCode($languageCode)) !== null) {
+ $languageID = $language->languageID;
+ }
+ else {
+ continue;
+ }
}
+
+ $contents[$languageID] = [
+ 'title' => (!empty($contentData['title']) ? $contentData['title'] : ''),
+ 'caption' => (!empty($contentData['caption']) ? $contentData['caption'] : ''),
+ 'altText' => (!empty($contentData['altText']) ? $contentData['altText'] : '')
+ ];
+ }
+ if (count($contents) > 1) {
+ $data['isMultilingual'] = 1;
}
-
- $contents[$languageID] = [
- 'title' => (!empty($contentData['title']) ? $contentData['title'] : ''),
- 'caption' => (!empty($contentData['caption']) ? $contentData['caption'] : ''),
- 'altText' => (!empty($contentData['altText']) ? $contentData['altText'] : '')
- ];
- }
- if (count($contents) > 1) {
- $data['isMultilingual'] = 1;
}
// handle language