From: Alexander Ebert Date: Tue, 2 Jan 2018 12:06:25 +0000 (+0100) Subject: Better fallback for language mismatches during page import X-Git-Tag: 3.1.0_RC_1~16^2~7 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9f5e1594384d97300e1f18b3ea131ec15f9b0cf8;p=GitHub%2FWoltLab%2FWCF.git Better fallback for language mismatches during page import --- 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 af113255d4..df2ba28719 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php @@ -116,10 +116,14 @@ class PagePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin // use the value for English $name = $data['elements']['name']['en']; } - else { + else if (isset($data['elements']['name'][''])) { // fallback to the display name without/empty language attribute $name = $data['elements']['name']['']; } + else { + // use whichever value is present, regardless of the language + $name = reset($data['elements']['name']); + } $parentPageID = null; if (!empty($data['elements']['parent'])) {