https://bugzilla.wikimedia.org/show_bug.cgi?id=32426
--- Comment #5 from [email protected] 2011-12-09 00:35:38 UTC --- See also: * https://bugzilla.wikimedia.org/show_bug.cgi?id=32883 * https://bugzilla.wikimedia.org/show_bug.cgi?id=32423 * https://bugzilla.wikimedia.org/show_bug.cgi?id=32883 Take this for example: {{{info | create title=Upload image | edit title=Edit image | page name=File:<Image[File]>}}} with a corresponding file upload field like this: {{{field | File | uploadable}}} As you can see from the info tag, the page to be edited is taken from the name of the file that's being uploaded. If the user ignores warnings that their file name is the same as an existing file, the file will be overwritten when they complete the upload. Hopefully the warnings make that obvious. However, what isn't obvious is that if the user also submits the form, the form will overwrite whatever semantic data was was on the file page before, without any warning, and perhaps without the user meaning to do that. So far, it appears this happens when * users are knowingly trying to upload a new version of a file, but do not know the semantic data will be overwritten too if they submit the form. * users are trying to upload a completely new file with the same name as an existing file, and they ignore the upload warnings because they don't understand the, or they simply don't read them. The upload replaces the original file. When they submit the form, new semantic data replaces the original semantic data, without warning. I don't know of any easy way around that. The best I've come up with is assigning random names to all uploaded files, so if the user ignores the warnings, nothing will be overwritten: {{{field | File | uploadable | default filename={{#time: U | now}}-{{#rand:0|9999}}.jpg}}} SF needs a way for form code to detect whether it is uploading or editing, and make decisions based on that. So far, checking for an output from {{PAGENAME}} is the only way I've been able to put that information into my code so I can display the form differently, perhaps with warnings that existing data will be overwritten if the form is submitted. Hopefully that is clearer. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
