From: Ben Klang Date: Fri, 26 Mar 2010 18:17:30 +0000 (-0400) Subject: Shout: Fix bug that deleted other menu actions inadvertently X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=43d2f31b7c5ccd46af2a6ce07bba70909563758a;p=horde.git Shout: Fix bug that deleted other menu actions inadvertently --- diff --git a/shout/lib/Driver/Sql.php b/shout/lib/Driver/Sql.php index 11748a237..93e55ae4c 100644 --- a/shout/lib/Driver/Sql.php +++ b/shout/lib/Driver/Sql.php @@ -211,8 +211,11 @@ class Shout_Driver_Sql extends Shout_Driver public function saveMenuAction($account, $menu, $digit, $action, $args) { // Remove any existing action - $sql = 'DELETE FROM menu_entries WHERE digit = ?'; - $values = array($digit); + $sql = 'DELETE FROM menu_entries WHERE menu_id = ' . + '(SELECT id FROM menus WHERE account_id = ' . + '(SELECT id FROM accounts WHERE code = ?) AND name = ?) ' . + 'AND digit = ?'; + $values = array($account, $menu, $digit); $msg = 'SQL query in Shout_Driver_Sql#saveMenuAction(): ' . $sql; Horde::logMessage($msg, 'DEBUG'); $result = $this->_write_db->query($sql, $values);