From: Matthias Schmidt Date: Mon, 19 Mar 2012 16:55:34 +0000 (+0100) Subject: Fixes ClipboardActionPackageInstallationPlugin X-Git-Tag: 2.0.0_Beta_1~1200^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=656718fc507caff971c8d0fa90d57b429fda7322;p=GitHub%2FWoltLab%2FWCF.git 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). --- 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;