From: Alexander Ebert Date: Mon, 30 Nov 2015 23:25:57 +0000 (+0100) Subject: Fixed page pip X-Git-Tag: 3.0.0_Beta_1~2030^2~223 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=05f26e5c6db3b899433a509d523de688890e3efc;p=GitHub%2FWoltLab%2FWCF.git Fixed page pip --- diff --git a/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php index 05da51ffb7..cdd33f2370 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php @@ -29,7 +29,7 @@ class PagePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin protected $content = []; /** - * @see AbstractXMLPackageInstallationPlugin::$tagName + * @inheritDoc */ public $tagName = 'page'; @@ -70,11 +70,11 @@ class PagePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin $elements[$element->tagName][$element->getAttribute('language')] = $children; } - else if ($element->tagName === 'displayname') { - // can occur multiple times using the `language` attribute - if (!isset($elements['displayName'])) $elements['displayName'] = []; + else if ($element->tagName === 'name') { + // can occur multiple times using the `language` attribute + if (!isset($elements['name'])) $elements['name'] = []; - $elements['displayName'][$element->getAttribute('language')] = $element->nodeValue; + $elements['name'][$element->getAttribute('language')] = $element->nodeValue; } else { $elements[$element->tagName] = $nodeValue; @@ -110,17 +110,17 @@ class PagePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin // pick the display name by choosing the default language, or 'en' or '' (empty string) $defaultLanguageCode = LanguageFactory::getInstance()->getDefaultLanguage()->getFixedLanguageCode(); - if (isset($data['elements']['displayName'][$defaultLanguageCode])) { + if (isset($data['elements']['name'][$defaultLanguageCode])) { // use the default language - $displayName = $data['elements']['displayName'][$defaultLanguageCode]; + $name = $data['elements']['name'][$defaultLanguageCode]; } - else if (isset($data['elements']['displayName']['en'])) { + else if (isset($data['elements']['name']['en'])) { // use the value for English - $displayName = $data['elements']['displayName']['en']; + $name = $data['elements']['name']['en']; } else { // fallback to the display name without/empty language attribute - $displayName = $data['elements']['displayName']['']; + $name = $data['elements']['name']['']; } $parentPageID = null; @@ -147,10 +147,10 @@ class PagePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin 'content' => ($isStatic) ? $data['elements']['content'] : [], 'controller' => ($isStatic) ? '' : $data['elements']['controller'], 'controllerCustomURL' => $customUrl, - 'displayName' => $displayName, 'identifier' => $data['attributes']['identifier'], 'isMultilingual' => ($isStatic) ? 1 : 0, 'lastUpdateTime' => TIME_NOW, + 'name' => $name, 'originIsSystem' => 1, 'parentPageID' => $parentPageID ]; @@ -183,7 +183,7 @@ class PagePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin $content = $data['content']; unset($data['content']); - if ($row !== false) { + if (!empty($row)) { // allow only updating of controller, everything else would overwrite user modifications if (!empty($data['controller'])) { $object = parent::import($row, ['controller' => $data['controller']]);