From ee9baaa94c617ccc8aa0eaf42f4e7576f6e6850e Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 13 Oct 2018 14:55:54 +0200 Subject: [PATCH] Fix issues with user profile menu PIP GUI See #2545 --- com.woltlab.wcf/tmp_userProfileMenu.xml | 23 +++++++++++++++++++ ...ileMenuPackageInstallationPlugin.class.php | 17 +++++++------- 2 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 com.woltlab.wcf/tmp_userProfileMenu.xml diff --git a/com.woltlab.wcf/tmp_userProfileMenu.xml b/com.woltlab.wcf/tmp_userProfileMenu.xml new file mode 100644 index 0000000000..c3afcbc9cf --- /dev/null +++ b/com.woltlab.wcf/tmp_userProfileMenu.xml @@ -0,0 +1,23 @@ + + + + + wcf\system\menu\user\profile\content\RecentActivityUserProfileMenuContent + 1 + + + wcf\system\menu\user\profile\content\CommentUserProfileMenuContent + 1 + module_user_profile_wall + + + wcf\system\menu\user\profile\content\LikesUserProfileMenuContent + module_like + 2 + + + wcf\system\menu\user\profile\content\AboutUserProfileMenuContent + 3 + + + diff --git a/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php index 275a1f6d4d..f15da67517 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php @@ -115,16 +115,17 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall $dataContainer = $form->getNodeById('data'); $dataContainer->appendChildren([ - TextFormField::create('name') - ->label('wcf.acp.pip.userProfileMenu.name') - ->description('wcf.acp.pip.userProfileMenu.name.description') + TextFormField::create('menuItem') + ->objectProperty('name') + ->label('wcf.acp.pip.userProfileMenu.eventName') + ->description('wcf.acp.pip.userProfileMenu.eventName.description') ->required() ->addValidator(new FormFieldValidator('format', function(TextFormField $formField) { if (!preg_match('~^[a-z][A-z]+$~', $formField->getValue())) { $formField->addValidationError( new FormFieldValidationError( 'format', - 'wcf.acp.pip.userProfileMenu.name.error.format' + 'wcf.acp.pip.userProfileMenu.menuItem.error.format' ) ); } @@ -138,7 +139,7 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall $formField->addValidationError( new FormFieldValidationError( 'notUnique', - 'wcf.acp.pip.userProfileMenu.name.error.notUnique' + 'wcf.acp.pip.userProfileMenu.menuItem.error.notUnique' ) ); } @@ -219,8 +220,8 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall */ protected function setEntryListKeys(IDevtoolsPipEntryList $entryList) { $entryList->setKeys([ - 'name' => 'wcf.acp.pip.userProfileMenu.name', - 'className' => 'wcf.acp.pip.userProfileMenu.className' + 'menuItem' => 'wcf.acp.pip.userProfileMenu.menuItem', + 'className' => 'wcf.form.field.className' ]); } @@ -265,7 +266,7 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall $userProfileMenuItem = $document->createElement('userprofilemenuitem'); $userProfileMenuItem->setAttribute('name', $data['name']); - $userProfileMenuItem->appendChild($document->createElement('classname', $data['className'])); + $userProfileMenuItem->appendChild($document->createElement('classname', $data['classname'])); foreach (['options', 'permissions', 'showorder'] as $optionalElement) { if (!empty($data[$optionalElement])) { -- 2.20.1