From b3a7389c79398a02215174d9994214c8ccb091ac Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 17 Nov 2018 10:37:51 +0100 Subject: [PATCH] Fix showOrder handling of smiley PIP GUI See #2545 --- .../SmileyPackageInstallationPlugin.class.php | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php index 9685b20248..25ca849228 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php @@ -238,7 +238,6 @@ class SmileyPackageInstallationPlugin extends AbstractXMLPackageInstallationPlug $optionalElements = [ 'aliases' => 'aliases', 'smileyPath2x' => 'path2x', - 'showOrder' => 'showOrder' ]; foreach ($optionalElements as $arrayKey => $elementName) { $child = $element->getElementsByTagName($elementName)->item(0); @@ -246,17 +245,21 @@ class SmileyPackageInstallationPlugin extends AbstractXMLPackageInstallationPlug $data[$arrayKey] = $child->nodeValue; } else { - if ($arrayKey === 'showOrder') { - if ($this->editedEntry === null) { - $data[$arrayKey] = $this->getShowOrder(null); - } - } - else { - $data[$arrayKey] = ''; - } + $data[$arrayKey] = ''; } } + $showOrder = $element->getElementsByTagName('showorder')->item(0); + if ($showOrder !== null) { + $data['showOrder'] = $showOrder->nodeValue; + } + if ($saveData && $this->editedEntry === null) { + // only set explicit showOrder when adding new menu item + $data['showOrder'] = $this->getShowOrder( + $data['showOrder'] ?? null + ); + } + return $data; } -- 2.20.1