Commit c9128882 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 347269: Deleting a user account displays incoherent comments - Patch by…

Bug 347269: Deleting a user account displays incoherent comments - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wurblzap a=justdave
parent 3bf04a6f
......@@ -468,14 +468,14 @@ if ($action eq 'search') {
$vars->{'longdescs'} = $dbh->selectrow_array(
'SELECT COUNT(*) FROM longdescs WHERE who = ?',
undef, $otherUserID);
$vars->{'namedqueries'} = $dbh->selectcol_arrayref(
my $namedquery_ids = $dbh->selectcol_arrayref(
'SELECT id FROM namedqueries WHERE userid = ?',
undef,
$otherUserID);
if (@{$vars->{'namedqueries'}}) {
undef, $otherUserID);
$vars->{'namedqueries'} = scalar(@$namedquery_ids);
if (scalar(@$namedquery_ids)) {
$vars->{'namedquery_group_map'} = $dbh->selectrow_array(
'SELECT COUNT(*) FROM namedquery_group_map WHERE namedquery_id IN' .
' (' . join(', ', @{$vars->{'namedqueries'}}) . ')');
' (' . join(', ', @$namedquery_ids) . ')');
}
else {
$vars->{'namedquery_group_map'} = 0;
......
......@@ -31,9 +31,9 @@
# flags.requestee: number of flags the viewed user is being asked for
# flags.setter: number of flags the viewed user has set
# longdescs: number of bug comments the viewed user has written
# namedqueries: array of IDs of named queries the user has created
# namedqueries: number of named queries the user has created
# namedquery_group_map: number of named queries the user has shared
# profiles_activity: number of named queries the user has created
# profiles_activity: number of changes made to other users' profiles
# series: number of series the viewed user has created
# votes: number of bugs the viewed user has voted on
# watch.watched: number of users the viewed user is being watched
......@@ -302,19 +302,19 @@
[% IF namedqueries %]
<li>
[% otheruser.login FILTER html %] has
[% IF namedqueries.size == 1 %]
[% IF namedqueries == 1 %]
a [% 'shared' IF namedquery_group_map %] named search
[% ELSE %]
[%+ namedqueries.size %] named searches
[%+ namedqueries FILTER html %] named searches
[% END %].
[% IF namedqueries.size == 1 %]
[% IF namedqueries == 1 %]
This named search
[% ELSE %]
These named searches
[% END %]
will be deleted along with the user account.
[% IF namedquery_group_map %]
[% IF namedqueries.size > 1 %]
[% IF namedqueries > 1 %]
Of these,
[% IF namedquery_group_map > 1 %]
[%+ namedquery_group_map FILTER html %] are
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment