summaryrefslogtreecommitdiff
path: root/modules/shortcut
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2011-07-29 14:33:59 -0400
committerDries Buytaert <dries@buytaert.net>2011-07-29 14:33:59 -0400
commit5fea4ed4f4b7801b54084c02c472f40116b61d05 (patch)
treed3381e986ad4b5125d38dbe6c1d89703faa9c6ae /modules/shortcut
parent3a45b53736691dc6bdbe2f31f1bf98b8936cf17e (diff)
downloadbrdo-5fea4ed4f4b7801b54084c02c472f40116b61d05.tar.gz
brdo-5fea4ed4f4b7801b54084c02c472f40116b61d05.tar.bz2
- Patch #1228888 by Johnny vd Laar: shortcut_set_unassign_user() deletes in the wrong table.
Diffstat (limited to 'modules/shortcut')
-rw-r--r--modules/shortcut/shortcut.module2
-rw-r--r--modules/shortcut/shortcut.test13
2 files changed, 14 insertions, 1 deletions
diff --git a/modules/shortcut/shortcut.module b/modules/shortcut/shortcut.module
index d2ac72b32..8642d9de7 100644
--- a/modules/shortcut/shortcut.module
+++ b/modules/shortcut/shortcut.module
@@ -460,7 +460,7 @@ function shortcut_set_assign_user($shortcut_set, $account) {
* to any set.
*/
function shortcut_set_unassign_user($account) {
- $deleted = db_delete('shortcut_set')
+ $deleted = db_delete('shortcut_set_users')
->condition('uid', $account->uid)
->execute();
return (bool) $deleted;
diff --git a/modules/shortcut/shortcut.test b/modules/shortcut/shortcut.test
index e37e1e5f8..75a5a67bf 100644
--- a/modules/shortcut/shortcut.test
+++ b/modules/shortcut/shortcut.test
@@ -313,6 +313,19 @@ class ShortcutSetsTestCase extends ShortcutTestCase {
}
/**
+ * Tests unassigning a shortcut set.
+ */
+ function testShortcutSetUnassign() {
+ $new_set = $this->generateShortcutSet($this->randomName(10));
+
+ shortcut_set_assign_user($new_set, $this->shortcut_user);
+ shortcut_set_unassign_user($this->shortcut_user);
+ $current_set = shortcut_current_displayed_set($this->shortcut_user);
+ $default_set = shortcut_default_set($this->shortcut_user);
+ $this->assertTrue($current_set->set_name == $default_set->set_name, "Successfully unassigned another user's shortcut set.");
+ }
+
+ /**
* Tests deleting a shortcut set.
*/
function testShortcutSetDelete() {