summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-04-11 07:43:13 +0200
committerByron Jones <bjones@mozilla.com>2013-04-11 07:43:13 +0200
commita0332766344dc9ec6dac5abb4a80a04622e32cbd (patch)
treea4aa51d2f9d6c76581fce502ec45cf90ec0e6c8c /extensions
parenteea82340bcb6b86b10e5c801fcee82010f3a667b (diff)
downloadbugzilla-a0332766344dc9ec6dac5abb4a80a04622e32cbd.tar.gz
bugzilla-a0332766344dc9ec6dac5abb4a80a04622e32cbd.tar.xz
Bug 850723: fix dropping of my_dashboard queries
Diffstat (limited to 'extensions')
-rw-r--r--extensions/MyDashboard/Extension.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/extensions/MyDashboard/Extension.pm b/extensions/MyDashboard/Extension.pm
index 036d1ce24..082f1c562 100644
--- a/extensions/MyDashboard/Extension.pm
+++ b/extensions/MyDashboard/Extension.pm
@@ -61,7 +61,7 @@ sub _in_mydashboard {
return $self->{'in_mydashboard'} if exists $self->{'in_mydashboard'};
$self->{'in_mydashboard'} = $dbh->selectrow_array("
SELECT 1 FROM mydashboard WHERE namedquery_id = ? AND user_id = ?",
- undef, $self->id, $self->user->id);
+ undef, $self->id, Bugzilla->user->id);
return $self->{'in_mydashboard'};
}
@@ -100,18 +100,18 @@ sub user_preferences {
my $params = Bugzilla->input_params;
if ($save) {
- my $sth_insert_fp = $dbh->prepare('INSERT INTO mydashboard
+ my $sth_insert_fp = $dbh->prepare('INSERT INTO mydashboard
(namedquery_id, user_id)
VALUES (?, ?)');
my $sth_delete_fp = $dbh->prepare('DELETE FROM mydashboard
WHERE namedquery_id = ?
AND user_id = ?');
- foreach my $q (@{$user->queries}, @{$user->queries_available}) {
+ foreach my $q (@{$user->queries}) {
if (defined $params->{'in_mydashboard_' . $q->id}) {
- $sth_insert_fp->execute($q->id, $q->user->id) if !$q->in_mydashboard;
+ $sth_insert_fp->execute($q->id, $user->id) if !$q->in_mydashboard;
}
else {
- $sth_delete_fp->execute($q->id, $q->user->id) if $q->in_mydashboard;
+ $sth_delete_fp->execute($q->id, $user->id) if $q->in_mydashboard;
}
}
}