Problems with integration of file uploading
Moderator: kcleung
Problems with integration of file uploading
Well... integration of file uploading into the file form has hit a problem: how do we verify the form prior to the files being uploaded?
I say this because if otherwise, the user will have to upload the entire thing again if he messes up some (unrelated) part of the submission form. This could especially present a huge problem for the multiple file submission form.
Javascript is nice, but not everyone has it turned on, and MediaWiki was designed to work without JS...
I say this because if otherwise, the user will have to upload the entire thing again if he messes up some (unrelated) part of the submission form. This could especially present a huge problem for the multiple file submission form.
Javascript is nice, but not everyone has it turned on, and MediaWiki was designed to work without JS...
-
- Groundskeeper
- Posts: 553
- Joined: Fri Feb 16, 2007 8:55 am
Re: Problems with integration of file uploading
You don't. There simply is no way of accomplishing this without JS.imslp wrote:how do we verify the form prior to the files being uploaded?
Now I can't tell you how to implement it technically, but I think the procedure should basically be the following: upload file in every case; verify submitted data; if it does not pass verification, return submission form without upload form, and with the previous user input + uploaded file name in the form fields (and a message saying what's wrong). It is probably unavoidable that if the user aborts at this point, we are left with an orphaned file, but I hope that this will occur much less frequently than now where the two steps are completely separated. Do you think that could work?
Re: Problems with integration of file uploading
Wow, I haven't thought of that. It could work, but will require rather extensive knowledge of the upload feature of Mediawiki (which currently does the same thing for warnings). About orphaned files, it is already present in the current setup (if someone aborts an upload when there's a warning) so we don't have to worry about it (except for me periodically deleting all the files in the temp folder).Leonard Vertighel wrote:Now I can't tell you how to implement it technically, but I think the procedure should basically be the following: upload file in every case; verify submitted data; if it does not pass verification, return submission form without upload form, and with the previous user input + uploaded file name in the form fields (and a message saying what's wrong). It is probably unavoidable that if the user aborts at this point, we are left with an orphaned file, but I hope that this will occur much less frequently than now where the two steps are completely separated. Do you think that could work?
But yes, that's a very nice idea that works nicely, and uses standard MW protocol
Ok... beta version out (if you can't see the link on the pages, force cache purge and view the page in English). Even though I call it a "beta" version, I've tested it extensively myself, and should not break easily The 6 hours of coding wasn't for nothing
P.S. It'd be nice if someone can test it in Opera and IE... I changed the table settings a little... theoretically should be for the better, but you never know with IE
P.S. It'd be nice if someone can test it in Opera and IE... I changed the table settings a little... theoretically should be for the better, but you never know with IE
-
- Groundskeeper
- Posts: 553
- Joined: Fri Feb 16, 2007 8:55 am
Great work. Looks fine in Opera 9/Linux.
There are a few XHTML errors that you may wish to fix. Change
to
(attributes must be lowercase and have a value)
to
(idem)
to
(you can't have text inside the "ul" element but outside of "li").
There are a few XHTML errors that you may wish to fix. Change
Code: Select all
<option SELECTED value=""></option>
Code: Select all
<option selected="selected" value=""></option>
Code: Select all
<option SELECTED>File (default)</option>
Code: Select all
<option selected="selected">File (default)</option>
Code: Select all
- Admin Tools -
Code: Select all
</ul>- Admin Tools -<ul>
-
- Groundskeeper
- Posts: 553
- Joined: Fri Feb 16, 2007 8:55 am
We have a problem: there are (if I'm not mistaken) 1567 work pages that do not contain the "AddFile" template. That's a bit too much to fix by hand. Thoughts? (I could try to code a bot, but this won't happen very soon, since right now I have almost no time. There exists also that pywikipedia bot framework thing, but unfortunately I know nothing about Python.)
I've also found 44 work pages that contain no "File*" template. Should I delete them straight away, or do you want to see the list?
I've also found 44 work pages that contain no "File*" template. Should I delete them straight away, or do you want to see the list?
Oops! I forgot about that :/ I think I'll just do some special page renaming, and it should be fine (i.e. "AddFile"=>"AddFileOld" and "AddFileNew"=>"AddFile").Leonard Vertighel wrote:We have a problem: there are (if I'm not mistaken) 1567 work pages that do not contain the "AddFile" template.
It is in one of the transitional formats (I seem to remember Schumann had a few pages like that)? In that case it is probably a good idea to just recreate the page and resubmit the file to the page.That's a bit too much to fix by hand. Thoughts? (I could try to code a bot, but this won't happen very soon, since right now I have almost no time. There exists also that pywikipedia bot framework thing, but unfortunately I know nothing about Python.)
I've also found 44 work pages that contain no "File*" template. Should I delete them straight away, or do you want to see the list?
-
- Groundskeeper
- Posts: 553
- Joined: Fri Feb 16, 2007 8:55 am
Fine. At some point however we should fix that nonetheless, so we can internationalize that part, too. A bot (if I get around to coding one) would actually cause less traffic and server load than human editors, since it can access the edit form directly, without loading the rendered page first. And it can be made to run arbitrarily slow to put minimum load on the server.imslp wrote:Oops! I forgot about that :/ I think I'll just do some special page renaming, and it should be fine (i.e. "AddFile"=>"AddFileOld" and "AddFileNew"=>"AddFile").Leonard Vertighel wrote:We have a problem: there are (if I'm not mistaken) 1567 work pages that do not contain the "AddFile" template.
I haven't looked through all of them, but it seems that they are just pages with no files at all. If there are no files (and the page is more than 24 hours old), delete and forget? Or do I have to notify the page creator for all 44 of them?imslp wrote:It is in one of the transitional formats (I seem to remember Schumann had a few pages like that)? In that case it is probably a good idea to just recreate the page and resubmit the file to the page.I've also found 44 work pages that contain no "File*" template. Should I delete them straight away, or do you want to see the list?
I've finished fixing it
And also, I was thinking that you coding a bot may be a very good idea... because I have absolutely no idea about bot writing (or Python), and so it'd be the same thing for me. Comparatively I am quite familiar with the Mediawiki internals, so I can take care of that part pretty efficiently Plus, with bots you don't have to wait for me to include it in the code.
And also, I was thinking that you coding a bot may be a very good idea... because I have absolutely no idea about bot writing (or Python), and so it'd be the same thing for me. Comparatively I am quite familiar with the Mediawiki internals, so I can take care of that part pretty efficiently Plus, with bots you don't have to wait for me to include it in the code.
-
- Groundskeeper
- Posts: 553
- Joined: Fri Feb 16, 2007 8:55 am
Actually I have no idea about Python either. The bots I had coded for the Italian Wikipedia were made in PHP, but they worked pretty well
By the way, how does the internationalization of the new templates (or rather, the underlying parser functions) work? Is it via MediaWiki messages, and if so, which?
By the way, how does the internationalization of the new templates (or rather, the underlying parser functions) work? Is it via MediaWiki messages, and if so, which?
Good enough for meLeonard Vertighel wrote:Actually I have no idea about Python either. The bots I had coded for the Italian Wikipedia were made in PHP, but they worked pretty well
I didn't put them as Mediawiki messages due to load concerns (that'd be a lot of SQL queries). Instead, they are embedded into the code. I intend to set up an internationalization page for the new work pages soon. But let me rest for a few days first (I've been spending something like 8 hours per day the last two days on IMSLP stuff).By the way, how does the internationalization of the new templates (or rather, the underlying parser functions) work? Is it via MediaWiki messages, and if so, which?
Also apparently I didn't see your last message when I posted... so here goes:
Well, the page will be automatically transformed the next time a file is submitted. So maybe we can wait for a while longer, and at the end of it clean up the remaining (hopefully very few) pages manually.Fine. At some point however we should fix that nonetheless, so we can internationalize that part, too. A bot (if I get around to coding one) would actually cause less traffic and server load than human editors, since it can access the edit form directly, without loading the rendered page first. And it can be made to run arbitrarily slow to put minimum load on the server.
Delete and forgetI haven't looked through all of them, but it seems that they are just pages with no files at all. If there are no files (and the page is more than 24 hours old), delete and forget? Or do I have to notify the page creator for all 44 of them?
-
- Groundskeeper
- Posts: 553
- Joined: Fri Feb 16, 2007 8:55 am
There is no hurry, I'm not going to work on it very soon anyway.imslp wrote:I didn't put them as Mediawiki messages due to load concerns (that'd be a lot of SQL queries). Instead, they are embedded into the code. I intend to set up an internationalization page for the new work pages soon. But let me rest for a few days first (I've been spending something like 8 hours per day the last two days on IMSLP stuff).
Waiting is OK, I don't have time right now to work on it anyway. Nonetheless I think a bot might be useful. We shall see...imslp wrote:So maybe we can wait for a while longer, and at the end of it clean up the remaining (hopefully very few) pages manually.
Done.imslp wrote:Delete and forget
I'd suggest adding a message to the old upload forms explaining that file upload is now integrated into the submission forms. Then later (say, in one or two weeks) we can remove the two upload forms from the sidebar, since they should almost never be needed (they will still be accessible from Special:Specialpages). The number of unsubmitted files has grown quite a bit recently, and "hiding" the two upload forms will hopefully slow down the growth.