From: Ben Klang Date: Sat, 3 Apr 2010 02:13:31 +0000 (-0400) Subject: Fix deleting the menu; correct SQL error on accounts X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7ca4d2c9c96f0e18c482677accc65b22ba777497;p=horde.git Fix deleting the menu; correct SQL error on accounts --- diff --git a/shout/lib/Driver/Sql.php b/shout/lib/Driver/Sql.php index 23283e3a8..36080dc2b 100644 --- a/shout/lib/Driver/Sql.php +++ b/shout/lib/Driver/Sql.php @@ -670,15 +670,18 @@ class Shout_Driver_Sql extends Shout_Driver if (isset($numbers[$number])) { $sql = 'UPDATE numbers SET ' . 'account_id = (SELECT id FROM accounts WHERE code = ?), ' . - 'menu_id = (SELECT id FROM menus WHERE name = ?) ' . + 'menu_id = (SELECT id FROM menus WHERE name = ? AND ' . + 'account_id = (SELECT id FROM accounts WHERE code = ?)) ' . 'WHERE did = ?'; + $values = array($account, $menu, $account, $number); } else { $sql = 'INSERT INTO numbers (account_id, menu_id, did) VALUES (' . '(SELECT id FROM accounts WHERE code = ?), ' . '(SELECT id FROM menus WHERE name = ?), ' . '?)'; + $values = array($account, $menu, $number); } - $values = array($account, $menu, $number); + $msg = 'SQL query in Shout_Driver_Sql#saveNumber(): ' . $sql; Horde::logMessage($msg, 'DEBUG'); $result = $this->_write_db->query($sql, $values); diff --git a/shout/wizard.php b/shout/wizard.php index 2999eccd5..6f7f6e2a2 100644 --- a/shout/wizard.php +++ b/shout/wizard.php @@ -61,6 +61,7 @@ try { 'star', 'admin_login', array()); $extensions = $shout->extensions->getExtensions($curaccount['code']); } catch (Exception $e) { + print_r($e); $notification->push($e); }