From: Frédéric Buclin Date: Fri, 16 Jul 2010 09:50:55 +0000 (+0200) Subject: Bug 578335: The "Show next bug in my list" user pref either doesn't display the next... X-Git-Tag: bugzilla-3.7.3~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70fa30cff5f61f3543220f7d4d5e20a7ad3dd1fa;p=thirdparty%2Fbugzilla.git Bug 578335: The "Show next bug in my list" user pref either doesn't display the next bug or display one from the wrong buglist r/a=mkanat --- diff --git a/Bugzilla/Search/Recent.pm b/Bugzilla/Search/Recent.pm index 79257a8519..6e24bd5bc7 100644 --- a/Bugzilla/Search/Recent.pm +++ b/Bugzilla/Search/Recent.pm @@ -32,7 +32,7 @@ use Bugzilla::Util; ############# use constant DB_TABLE => 'profile_search'; -use constant LIST_ORDER => 'id'; +use constant LIST_ORDER => 'id DESC'; use constant DB_COLUMNS => qw( id diff --git a/process_bug.cgi b/process_bug.cgi index 7126d5d8b7..3e7f66c970 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -189,13 +189,11 @@ $vars->{'title_tag'} = "bug_processed"; my $action; if (defined $cgi->param('id')) { - $action = Bugzilla->user->settings->{'post_bug_submit_action'}->{'value'}; + $action = $user->settings->{'post_bug_submit_action'}->{'value'}; if ($action eq 'next_bug') { - my @bug_list; - if ($cgi->cookie("BUGLIST")) { - @bug_list = split(/:/, $cgi->cookie("BUGLIST")); - } + my $bug_list_obj = $user->recent_search_for($first_bug); + my @bug_list = $bug_list_obj ? @{$bug_list_obj->bug_list} : (); my $cur = firstidx { $_ eq $cgi->param('id') } @bug_list; if ($cur >= 0 && $cur < $#bug_list) { my $next_bug_id = $bug_list[$cur + 1];