]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 767308 - Bug id should be last field in URL query string (after list_id)
authorDave Lawrence <dlawrence@mozilla.com>
Mon, 23 Jul 2012 21:58:45 +0000 (17:58 -0400)
committerDave Lawrence <dlawrence@mozilla.com>
Mon, 23 Jul 2012 21:58:45 +0000 (17:58 -0400)
r=glob, a=LpSolit

template/en/default/bug/show-header.html.tmpl

index 095b91086cb48986da52dc17413ff74a3081869b..6d4e2d595ac11b03c38c66e2c3b3e02b018b92d2 100644 (file)
 [% IF bug.defined %]
   [% unfiltered_title = "$terms.Bug $bug.bug_id – $bug.short_desc" %]
   [% javascript =  BLOCK %]
-    if( !document.location.href.match(/show_bug\.cgi/) && history && history.replaceState ) {
-      history.replaceState( null, 
-                         "[% unfiltered_title FILTER js %]",  
-                         "show_bug.cgi?id=[% bug.bug_id FILTER js %]" );
-      document.title = "[% unfiltered_title FILTER js %]";
+    if (history && history.replaceState) {
+      if(!document.location.href.match(/show_bug\.cgi/)) {
+        history.replaceState( null, 
+                             "[% unfiltered_title FILTER js %]",  
+                             "show_bug.cgi?id=[% bug.bug_id FILTER js %]" );
+        document.title = "[% unfiltered_title FILTER js %]";
+      }
+      if (document.location.href.match(/show_bug\.cgi\?.*list_id=/)) {
+        var href = document.location.href;
+        href = href.replace(/[\?&]+list_id=(\d+|cookie)/, '');
+        history.replaceState(null, "[% unfiltered_title FILTER js %]", href);
+      }
     }
     [% javascript FILTER none %]
   [% END %]