]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 274397 - Editing a saved search should now work even after clicking "Show List...
authorjake%bugzilla.org <>
Thu, 23 Dec 2004 17:52:09 +0000 (17:52 +0000)
committerjake%bugzilla.org <>
Thu, 23 Dec 2004 17:52:09 +0000 (17:52 +0000)
Patch by Colin S. Ogilvie <colin.ogilvie@gmail.com>
r=wurblzap, a=justdave

buglist.cgi
userprefs.cgi

index 67f63de950e184b5c57cb366b988fc55b55b11c8..7858f9590185450693bc02f3059fcd8688fb2f05 100755 (executable)
@@ -132,10 +132,11 @@ if ($::FORM{'regetlastlist'}) {
     $::COOKIE{'BUGLIST'} || ThrowUserError("missing_cookie");
 
     $order = "reuse last sort" unless $order;
-
+    my $bug_id = $::COOKIE{'BUGLIST'};
+    $bug_id =~ s/:/,/g;
     # set up the params for this new query
     $params = new Bugzilla::CGI({
-                                 bug_id => [split(/:/, $::COOKIE{'BUGLIST'})],
+                                 bug_id => $bug_id,
                                  order => $order,
                                 });
 }
@@ -309,13 +310,6 @@ if ($::FORM{'cmdtype'} eq "dorem") {
         $params = new Bugzilla::CGI($::buffer);
         $order = $params->param('order') || $order;
 
-        # backward compatibility hack: if the saved query doesn't say which
-        # form was used to create it, assume it was on the advanced query
-        # form - see bug 252295
-        if (!$params->param('query_format')) {
-            $params->param('query_format', 'advanced');
-            $::buffer = $params->query_string;
-        }
     }
     elsif ($::FORM{'remaction'} eq "runseries") {
         $::buffer = LookupSeries($::FORM{"series_id"});
@@ -418,6 +412,13 @@ elsif (($::FORM{'cmdtype'} eq "doit") && $::FORM{'remtype'}) {
     }
 }
 
+# backward compatibility hack: if the saved query doesn't say which
+# form was used to create it, assume it was on the advanced query
+# form - see bug 252295
+if (!$params->param('query_format')) {
+    $params->param('query_format', 'advanced');
+    $::buffer = $params->query_string;
+}
 
 ################################################################################
 # Column Definition
index f71fdec02cd7dd0c0530b6c6836bbaecd1735483..f8de9915d73740035d30a3680d0241ce99972526 100755 (executable)
@@ -298,8 +298,23 @@ sub DoPermissions {
 
 
 sub DoSavedSearches() {
+    # 2004-12-13 - colin.ogilvie@gmail.com, bug 274397
+    # Need to work around the possibly missing query_format=advanced
     $vars->{'user'} = Bugzilla->user;
-    $vars->{'queries'} = Bugzilla->user->queries;
+    my @queries = @{Bugzilla->user->queries};
+    my @newqueries;
+    foreach my $q (@queries) {
+        if ($q->{'query'} !~ /query_format=(advanced|specific)/) {
+            if ($q->{'query'} =~ /query_format=&/) {
+                $q->{'query'} =~ s/query_format=&/query_format=advanced&/;
+            }
+            else {
+                $q->{'query'} .= '&query_format=advanced';
+            }
+        }
+        push @newqueries, $q;
+    }
+    $vars->{'queries'} = \@newqueries;
 }
 
 sub SaveSavedSearches() {