Fix writing menu or parent element of menu items via GUI
authorMatthias Schmidt <gravatronics@live.com>
Sun, 14 Oct 2018 10:35:07 +0000 (12:35 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 14 Oct 2018 10:35:07 +0000 (12:35 +0200)
See #2545

wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php

index 5baca1fec83a965a2e7e7a8fe0695de18ddb5809..30594957704d2f73081f6471157efbced74bf7d6 100644 (file)
@@ -554,12 +554,12 @@ class MenuItemPackageInstallationPlugin extends AbstractXMLPackageInstallationPl
                $menuItem = $document->createElement($this->tagName);
                $menuItem->setAttribute('identifier', $data['identifier']);
                
-               if (!empty($data['menu'])) {
-                       $menuItem->appendChild($document->createElement('menu', $data['menu']));
-               }
-               else if (!empty($data['parent'])) {
+               if (!empty($data['parent'])) {
                        $menuItem->appendChild($document->createElement('parent', $data['parent']));
                }
+               else if (!empty($data['menu'])) {
+                       $menuItem->appendChild($document->createElement('menu', $data['menu']));
+               }
                
                foreach ($formData['title_i18n'] as $languageID => $title) {
                        $title = $document->createElement('title', $this->getAutoCdataValue($title));