Last modified: 2008-02-28 00:59:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T15130, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 13130 - Position of wpEditToken input tag in edit form
Position of wpEditToken input tag in edit form
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
1.12.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-23 19:03 UTC by Charlotte Webb
Modified: 2008-02-28 00:59 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Fix location of the summary and edit token hidden inputs (4.24 KB, patch)
2008-02-24 06:45 UTC, Daniel Friesen
Details

Description Charlotte Webb 2008-02-23 19:03:52 UTC
When using slower connections, my edits sometimes fail because I have already clicked the "save" button before the page has finished loading.

Part of the problem is that the ever-growing list of insertTags() links for special characters found at <http://en.wikipedia.org/wiki/MediaWiki:Edittools>, also located within the edit <form> takes toofuckinglong to load.

(I am not aware of any way to disable the entire mw-editTools section other than using "display:none" in CSS, which does hide it but doesn't make the page load any faster. On a related note, an option in Special:Preferences to completely omit this would be great too)

The following lines appear about 55 Kb later, AT THE END of the <form>:

<input type='hidden' value="[redacted]+\" name="wpEditToken" />
<input name="wpAutoSummary" type="hidden" value="[redacted]" /></form>

Could we please move these items upward?

I think the ideal place would be within the <div class="editbuttons"> and directly before <input id="wpSave" ... />, as editing is apparently guaranteed to fail if wpSave is clicked with no defined wpEditToken value!

CW
Comment 1 Victor Vasiliev 2008-02-23 19:34:50 UTC
Fixed in r31223
Comment 2 Brion Vibber 2008-02-24 02:04:19 UTC
Reverted in r31228.

The token is placed below the text box in part to ensure that everything is transmitted together successfully. This commit moved it up above the text box, where we would lose that protection.
Comment 3 Daniel Friesen 2008-02-24 06:45:37 UTC
Created attachment 4670 [details]
Fix location of the summary and edit token hidden inputs

I think this patch should be good for both parties.

It fixes two or three things.

The wpEditToken is now located after the save buttons, but before any of the edittools or extra page information.

This location should be optimum as it ensures that the input is located after all the vital inputs are displayed, but before all the extra form cruft which only serves visual purpose and has no relevance to the submit data.

Additionally a change to the location of wpIgnoreBlankSummary and wpAutoSummary is made.
Previously these were located at the bottom of the form alongside the edit token. As with the comment about the edit token being missed, it's possible for these to be missed if everything has not loaded yet.
The patch moves these two inputs to a location right after the summary field to make sure they are loaded together.
The wpIgnoreBlankSummary is especially important as users who have the "Prompt me when entering a blank edit summary" preference enabled will need to load for the entire form to load twice if they entered a blank summary.
Comment 4 Huji 2008-02-24 07:23:42 UTC
I'm not sure, but if wpIgnoreBlankSummary is there to be used by a javascript code that alerts the users when they leave the summary field blank, and if this javascript code is run "onLoad", the user has to load the full page anyways.
Comment 5 Daniel Friesen 2008-02-24 07:33:00 UTC
wpIgnoreBlankSummary is used by the server, not JavaScript.

When a user with that preference enters a summary which is blank (verified by the wpAutoSummary hidden field, so it's data is needed). The page does not instantly save, instead the edit form shows itself again with a notice up top, and the wpIgnoreBlankSummary is added inside the page with a value of 1 to prevent that message from coming up again. So basically a user presses the save button twice when they have that option enabled if they want to save a blank edit summary.

I forgot to note it when I made the attachment. But I also fixed a little inconsistency. Previously a HTML string was used to create wpIgnoreBlankSummary and wfHidden(); was used to create wpAutoSummary. They both now use wfHidden();
Comment 6 Charlotte Webb 2008-02-24 21:30:49 UTC
(In reply to comment #2)
> Reverted in r31228.
> 
> The token is placed below the text box in part to ensure that everything is
> transmitted together successfully. This commit moved it up above the text box,
> where we would lose that protection.
> 

Perhaps there was some misunderstanding then.

I suggested putting the token inside <div class='editButtons'> or elsewhere in the vicinity of the wpSave button which is (a) safely below the <textarea> and (b) useless when wpEditToken is not (yet) present.

I agree that putting the token above the <textarea> is an obvious bad idea.

CW
Comment 7 Brion Vibber 2008-02-28 00:59:48 UTC
Applied with slight modification in r31365 (hidden cats now in there too). Looks good so far!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links