- Patch #1228888 by Johnny vd Laar: shortcut_set_unassign_user() deletes in the wrong table.

merge-requests/26/head
Dries Buytaert 2011-07-29 14:33:59 -04:00
parent 3a45b53736
commit 5fea4ed4f4
2 changed files with 14 additions and 1 deletions

View File

@ -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;

View File

@ -312,6 +312,19 @@ class ShortcutSetsTestCase extends ShortcutTestCase {
$this->assertNotEqual($set->title, $existing_title, t('The shortcut set %title cannot be renamed to %new-title because a shortcut set with that title already exists.', array('%title' => $set->title, '%new-title' => $existing_title)));
}
/**
* 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.
*/