Last modified: 2009-02-27 18:47:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 17200 - Reuploading a file saves to source file name (regression)
Reuploading a file saves to source file name (regression)
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
unspecified
All All
: Normal major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-28 15:26 UTC by Lupo
Modified: 2009-02-27 18:47 UTC (History)
5 users (show)

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


Attachments

Description Lupo 2009-01-28 15:26:34 UTC
Reuploading a file saves the file under the source name, not under the name of the already existing file.

It appears that the problem is the disabled wpDestFile field. Apparently at least Firefox 3.0.5 does not send that disabled field upon submit, and SpecialUpload.php thus reverts to using the source name instead (lines 403-407 in r46444).

Enabling the wpDestFile field just before submitting cured the problem in my tests.

Test case: go to [[File:Albert_Einstein_by_Suse_Byk.png]] at the English Wikipedia. Click the "Upload new version of this file" link. Choose as the source file a file named HCC.png from your local disk. Enter "Foo" as the upload comment. Click "Upload". You'll end up uploading [[File:HCC.png]].
Comment 1 Lupo 2009-01-28 16:24:26 UTC
According to http://www.w3.org/TR/html401/interact/forms.html#h-17.12 this is standard behavior. Disabled controls do not get submitted (they're never "successful", see http://www.w3.org/TR/html401/interact/forms.html#successful-controls ). It appears the proper fix would be to change that field from disabled to readonly (line 1124, maybe also line 1107 for uploads by URL?).


 
Comment 2 Lupo 2009-01-28 19:51:38 UTC
Hm, maybe readonly isn't good either. They still get the focus... maybe add the
desired (fixed) destination file name in an additional hidden input field?
Comment 3 Mike.lifeguard 2009-01-28 19:55:06 UTC
*** Bug 17193 has been marked as a duplicate of this bug. ***
Comment 4 Aaron Schulz 2009-01-28 19:58:37 UTC
Fixed in r46475
Comment 5 Lupo 2009-01-28 20:02:42 UTC
Erm, Aaron, did you test? See my comment above: readonly fields still get the focus. On FF 3.0.5, I can even edit the field if I set it to readonly via JS (though I didn't check what happens with my edits). That's hyper-confusing.

Oh, and bug 17193 is *not* a dupe of this one. (Which Mike corrected over there, but I thought it'd be worth pointing out here, too.)
Comment 6 Aaron Schulz 2009-01-28 20:05:13 UTC
Yes, I tested it on my local install. It fixes the issue of not submitting the data.
Comment 7 Aaron Schulz 2009-01-28 20:22:34 UTC
OK, not sure how worry I am about custom JS. I'll play around with it a bit.
Comment 8 Aaron Schulz 2009-01-28 20:25:22 UTC
I'm not able to edit the readonly field.
Comment 9 Aaron Schulz 2009-01-28 22:27:18 UTC
(In reply to comment #8)
> I'm not able to edit the readonly field.
> 

Closing. If there is some weird JS issue, then that is a separate bug.
Comment 10 Ilmari Karonen 2009-02-04 22:14:33 UTC
(In reply to comment #4)
> Fixed in r46475

This still has some minor UI issues: the read-only field remains focusable (as Lupo notes above) and gives no visual indication of being uneditable -- it just doesn't react to typing, quite probably making some users wonder if their browser has a bug or something.

We could gray it out with CSS and give it a high tabindex or something, but I think an even better solution would be to just make the field hidden and replace it with plain text: that way it's obvious to anyone that it can't be changed.
Comment 11 Aaron Schulz 2009-02-04 22:40:53 UTC
hmm, FF (3) seems to grey it out already
Comment 12 Brion Vibber 2009-02-27 18:47:42 UTC
(In reply to comment #10)
> (In reply to comment #4)
> > Fixed in r46475
> 
> This still has some minor UI issues: the read-only field remains focusable (as
> Lupo notes above) and gives no visual indication of being uneditable -- it just
> doesn't react to typing, quite probably making some users wonder if their
> browser has a bug or something.

Broke out to bug 17707.

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


Navigation
Links