From 656718fc507caff971c8d0fa90d57b429fda7322 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 19 Mar 2012 17:55:34 +0100 Subject: [PATCH] Fixes ClipboardActionPackageInstallationPlugin Previously, an actionName has to be unique within a package, now the combination of actionName and actionClassName has to be unique within a package. Without this fix, you can't install two actions named "delete" within one file - even if they are for a completely different actionClass and page(s). --- .../plugin/ClipboardActionPackageInstallationPlugin.class.php | 4 ++++ wcfsetup/setup/db/install.sql | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php index 90f1cefd9b..21aabe7af7 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php @@ -40,11 +40,13 @@ class ClipboardActionPackageInstallationPlugin extends AbstractXMLPackageInstall protected function handleDelete(array $items) { $sql = "DELETE FROM wcf".WCF_N."_".$this->tableName." WHERE actionName = ? + AND actionClassName = ? AND packageID = ?"; $statement = WCF::getDB()->prepareStatement($sql); foreach ($items as $item) { $statement->execute(array( $item['attributes']['name'], + $item['elements']['actionclassname'], $this->installation->getPackageID() )); } @@ -91,9 +93,11 @@ class ClipboardActionPackageInstallationPlugin extends AbstractXMLPackageInstall $sql = "SELECT * FROM wcf".WCF_N."_".$this->tableName." WHERE actionName = ? + AND actionClassName = ? AND packageID = ?"; $parameters = array( $data['actionName'], + $data['actionClassName'], $this->installation->getPackageID() ); diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index a78f3c67d0..0850825fde 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -107,7 +107,7 @@ CREATE TABLE wcf1_clipboard_action ( actionName VARCHAR(50) NOT NULL DEFAULT '', actionClassName VARCHAR(200) NOT NULL DEFAULT '', showOrder INT(10) NOT NULL DEFAULT 0, - UNIQUE KEY actionName (packageID, actionName) + UNIQUE KEY actionName (packageID, actionName, actionClassName) ); DROP TABLE IF EXISTS wcf1_clipboard_item; -- 2.20.1