Closed Bug 1272548 Opened 8 years ago Closed 8 years ago

bug link in header broken if format param specified

Categories

(bugzilla.mozilla.org :: User Interface, defect)

Production
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: glob, Unassigned)

References

Details

Attachments

(1 file)

str:

1. https://bugzilla.mozilla.org/show_bug.cgi?id=1150541&format=modal
2. click on the "bug 1150541" link in the top left corner

expected:

page refreshed, with the format retained

actual:

https://bugzilla.mozilla.org/show_bug.cgi?id=1150541%26amp%3Bformat%3Dmodal
'1150541&format=modal' is not a valid bug number nor an alias to a bug.
Assignee: nobody → dylan
Comment on attachment 8753970 [details] [diff] [review]
1272548_1.patch

Review of attachment 8753970 [details] [diff] [review]:
-----------------------------------------------------------------

r=dkl

::: extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
@@ +170,5 @@
> +        [% IF cgi.param("format") %]
> +          [% format_uri = cgi.param("format") FILTER uri %]
> +          [% this_bug_href = this_bug_href _ "&format=" _ format_uri %]
> +        [% END %]
> +        <a id="this-bug" href="[% this_bug_href FILTER html %]">

Your way is cleaner in that it leaves off &format= if not defined. We could also just do:

diff --git a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
index 25f785a..959dcf9 100644
--- a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
@@ -166,8 +166,8 @@
         view_only = 1
     %]
       <div id="field-value-bug_id">
-        <a id="this-bug" href="show_bug.cgi?id=[% bug.id FILTER none %]
-                [%~ '&amp;format=' _ cgi.param("format") FILTER uri IF cgi.param("format") %]"
+        <a id="this-bug" href="show_bug.cgi?id=[% bug.id FILTER none %]&amp;format=
+                [%~ cgi.param("format") FILTER uri IF cgi.param("format") %]"
         >
           [%~ terms.Bug _ " " _ bug.id FILTER none ~%]
         </a>

Leave it up to you.
Attachment #8753970 - Flags: review?(dkl) → review+
To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   3eb0bba..01ea5ee  master -> master
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Assignee: dylan → nobody
Component: User Interface: Modal → User Interface
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: