Closed Bug 126487 Opened 24 years ago Closed 24 years ago

Edit attachment as comment submits attachment as comment before user can edit

Categories

(Bugzilla :: Attachments & Requests, defect)

2.15
defect
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: asa, Assigned: myk)

Details

Attachments

(1 file)

Edit attachment as comment submits attachment as comment before user can edit. I believe this broke when jkeiser checked in some form submission changes in the last few days. You can test by clicking the button "edit attachment as comment" at this landfill bug http://landfill.tequilarista.org/bugzilla-tip/attachment.cgi?id=18&action=edit (or some other less spammy bug if you prefer).
Attached patch PatchSplinter Review
This probably isn't the long-term fix, but it does solve the immidate problem.
Comment on attachment 70377 [details] [diff] [review] Patch r=bbaetz x 2. jkeiser says that this is correct, too, and it WFM.
Attachment #70377 - Flags: review+
Checked in... still have to do something about redisigning that page :)
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment on attachment 70377 [details] [diff] [review] Patch >Index: edit.atml >=================================================================== >RCS file: /cvsroot/mozilla/webtools/bugzilla/template/default/attachment/edit.atml,v >retrieving revision 1.9 >diff -u -r1.9 edit.atml >--- edit.atml 12 Feb 2002 22:55:25 -0000 1.9 >+++ edit.atml 19 Feb 2002 21:33:09 -0000 >@@ -188,9 +188,9 @@ > <script type="application/x-javascript" language="JavaScript"> > <!-- > if (typeof document.getElementById == "function") { >- document.write('<button id="editButton" onclick="editAsComment();">Edit Attachment As Comment</button>'); >- document.write('<button id="undoEditButton" onclick="undoEditAsComment();" style="display: none;">Undo Edit As Comment</button>'); >- document.write('<button id="redoEditButton" onclick="redoEditAsComment();" style="display: none;">Redo Edit As Comment</button>'); >+ document.write('<button type="button" id="editButton" onclick="editAsComment();">Edit Attachment As Comment</button>'); >+ document.write('<button type="button" id="undoEditButton" onclick="undoEditAsComment();" style="display: none;">Undo Edit As Comment</button>'); >+ document.write('<button type="button" id="redoEditButton" onclick="redoEditAsComment();" style="display: none;">Redo Edit As Comment</button>'); > } > //--> > </script>
Comment on attachment 70377 [details] [diff] [review] Patch >Index: edit.atml >=================================================================== >RCS file: /cvsroot/mozilla/webtools/bugzilla/template/default/attachment/edit.atml,v >retrieving revision 1.9 >diff -u -r1.9 edit.atml >--- edit.atml 12 Feb 2002 22:55:25 -0000 1.9 >+++ edit.atml 19 Feb 2002 21:33:09 -0000 >@@ -188,9 +188,9 @@ > <script type="application/x-javascript" language="JavaScript"> > <!-- > if (typeof document.getElementById == "function") { >- document.write('<button id="editButton" onclick="editAsComment();">Edit Attachment As Comment</button>'); >- document.write('<button id="undoEditButton" onclick="undoEditAsComment();" style="display: none;">Undo Edit As Comment</button>'); >- document.write('<button id="redoEditButton" onclick="redoEditAsComment();" style="display: none;">Redo Edit As Comment</button>'); >+ document.write('<button type="button" id="editButton" onclick="editAsComment();">Edit Attachment As Comment</button>'); >+ document.write('<button type="button" id="undoEditButton" onclick="undoEditAsComment();" style="display: none;">Undo Edit As Comment</button>'); >+ document.write('<button type="button" id="redoEditButton" onclick="redoEditAsComment();" style="display: none;">Redo Edit As Comment</button>'); > } > //--> > </script>
Comment on attachment 70377 [details] [diff] [review] Patch >Index: edit.atml >=================================================================== >RCS file: /cvsroot/mozilla/webtools/bugzilla/template/default/attachment/edit.atml,v >retrieving revision 1.9 >diff -u -r1.9 edit.atml >--- edit.atml 12 Feb 2002 22:55:25 -0000 1.9 >+++ edit.atml 19 Feb 2002 21:33:09 -0000 >@@ -188,9 +188,9 @@ > <script type="application/x-javascript" language="JavaScript"> > <!-- > if (typeof document.getElementById == "function") { >- document.write('<button id="editButton" onclick="editAsComment();">Edit Attachment As Comment</button>'); >- document.write('<button id="undoEditButton" onclick="undoEditAsComment();" style="display: none;">Undo Edit As Comment</button>'); >- document.write('<button id="redoEditButton" onclick="redoEditAsComment();" style="display: none;">Redo Edit As Comment</button>'); >+ document.write('<button type="button" id="editButton" onclick="editAsComment();">Edit Attachment As Comment</button>'); >+ document.write('<button type="button" id="undoEditButton" onclick="undoEditAsComment();" style="display: none;">Undo Edit As Comment</button>'); >+ document.write('<button type="button" id="redoEditButton" onclick="redoEditAsComment();" style="display: none;">Redo Edit As Comment</button>'); > } > //--> > </script>
Mozilla has always submitted when <button> does not have a type. I just tested with 0.9.4 as well as a build from the first. I think this must have been a recent Bugzilla change. This is mandated in the spec: http://www.w3.org/TR/html401/interact/forms.html#adef-type-BUTTON
Comment on attachment 70377 [details] [diff] [review] Patch >Index: edit.atml >=================================================================== >RCS file: /cvsroot/mozilla/webtools/bugzilla/template/default/attachment/edit.atml,v >retrieving revision 1.9 >diff -u -r1.9 edit.atml >--- edit.atml 12 Feb 2002 22:55:25 -0000 1.9 >+++ edit.atml 19 Feb 2002 21:33:09 -0000 >@@ -188,9 +188,9 @@ > <script type="application/x-javascript" language="JavaScript"> > <!-- > if (typeof document.getElementById == "function") { >- document.write('<button id="editButton" onclick="editAsComment();">Edit Attachment As Comment</button>'); >- document.write('<button id="undoEditButton" onclick="undoEditAsComment();" style="display: none;">Undo Edit As Comment</button>'); >- document.write('<button id="redoEditButton" onclick="redoEditAsComment();" style="display: none;">Redo Edit As Comment</button>'); >+ document.write('<button type="button" id="editButton" onclick="editAsComment();">Edit Attachment As Comment</button>'); >+ document.write('<button type="button" id="undoEditButton" onclick="undoEditAsComment();" style="display: none;">Undo Edit As Comment</button>'); >+ document.write('<button type="button" id="redoEditButton" onclick="redoEditAsComment();" style="display: none;">Redo Edit As Comment</button>'); > } > //--> > </script>
Comment on attachment 70377 [details] [diff] [review] Patch >Index: edit.atml >=================================================================== >RCS file: /cvsroot/mozilla/webtools/bugzilla/template/default/attachment/edit.atml,v >retrieving revision 1.9 >diff -u -r1.9 edit.atml >--- edit.atml 12 Feb 2002 22:55:25 -0000 1.9 >+++ edit.atml 19 Feb 2002 21:33:09 -0000 Testing fix on bmo.
applied this fix to b.m.o
What happens here if the user's JS is off?
fixing incorrect milestones on fixed bugs.
Target Milestone: --- → Bugzilla 2.16
Component: Creating/Changing Bugs → attachment and request management
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: