Page MenuHomePhabricator

Error messages from AbuseFilter shown in UploadWizard and upload dialog are not fully parsed (no templates)
Closed, ResolvedPublic

Description

Error messages from AbuseFilter shown in UploadWizard and upload dialog are not fully parsed (only jqueryMsg, not PHP parser).

Support for templates is critical here, as many of these messages on Commons use {{autotranslate}} to transclude text from the Template namespace – this allows all users to translate them (in the MediaWiki namespace, where messages reside, only sysops can edit).

Event Timeline

matmarex created this task.Aug 29 2016, 9:00 PM
Restricted Application added a project: Multimedia. · View Herald TranscriptAug 29 2016, 9:00 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
matmarex renamed this task from Error messages from AbuseFilter shown in UploadWizard and upload dialog are not fully parsed (only jqueryMsg, not PHP parser) to Error messages from AbuseFilter shown in UploadWizard and upload dialog are not fully parsed (no templates).Aug 30 2016, 4:15 PM
Restricted Application added a subscriber: Matanya. · View Herald TranscriptAug 30 2016, 4:15 PM

Change 307529 had a related patch set uploaded (by Bartosz Dziewoński):
mw.api.messages: Allow passing extra parameters for the API call

https://gerrit.wikimedia.org/r/307529

Change 307530 had a related patch set uploaded (by Bartosz Dziewoński):
mw.Upload.BookletLayout: Use 'amenableparser' to handle templates in error messages

https://gerrit.wikimedia.org/r/307530

Change 307531 had a related patch set uploaded (by Bartosz Dziewoński):
mw.UploadWizardDetails, mw.UploadWizardUpload: Use 'amenableparser' to handle templates in error messages

https://gerrit.wikimedia.org/r/307531

Example results when attempting to upload a file (

) blocked by filter 153 (cross-wiki) or 156 (UW), before and after the patches above:

[note that you have to test with a newly registered account]

BeforeAfter
UploadWizard
Cross-wiki upload dialog

Note that this only adds support for templates (and parser functions), and the subset of wikitext that can be parsed is still limited (as evident from the UploadWizard "after" screenshot). Among others, table syntax and embedded images are not supported.

@Steinsplitter Is it necessary for that error message to be wrapped in {{Abusefilter-warning|...}}? Even if I were to implement support for complete wikitext (so basically, parse the message server-side), the current error message (https://commons.wikimedia.org/w/index.php?title=MediaWiki:Abusefilter-warning-copyv2&oldid=205087996) would look silly when inserted into the interface (a quick mockup:

).

matmarex triaged this task as High priority.Aug 30 2016, 5:09 PM
Steinsplitter added a comment.EditedAug 30 2016, 5:15 PM

@Steinsplitter Is it necessary for that error message to be wrapped in {{Abusefilter-warning|...}}? Even if I were to implement support for complete wikitext (so basically, parse the message server-side), the current error message (https://commons.wikimedia.org/w/index.php?title=MediaWiki:Abusefilter-warning-copyv2&oldid=205087996) would look silly when inserted into the interface (a quick mockup:

).

Thanks for the fix :-).

Regarding the red warning box: It can be removed if needed, no problem.

Change 307529 merged by jenkins-bot:
mw.api.messages: Allow passing extra parameters for the API call

https://gerrit.wikimedia.org/r/307529

Change 307531 merged by jenkins-bot:
mw.UploadWizardDetails, mw.UploadWizardUpload: Use 'amenableparser' to handle templates in error messages

https://gerrit.wikimedia.org/r/307531

Change 307530 merged by jenkins-bot:
mw.Upload.BookletLayout: Use 'amenableparser' to handle templates in error messages

https://gerrit.wikimedia.org/r/307530

MarkTraceur closed this task as Resolved.Sep 2 2016, 8:05 PM

I think it would be good to backport those, so that we can tweak the messages on Commons and actually see how they play with the UW and cross-wiki dialog interfaces. I'll schedule a deployment for Monday "European Mid-day SWAT" (https://wikitech.wikimedia.org/wiki/Deployments#deploycal-item-20160905T1300).

Change 308262 had a related patch set uploaded (by Bartosz Dziewoński):
mw.api.messages: Allow passing extra parameters for the API call

https://gerrit.wikimedia.org/r/308262

Change 308267 had a related patch set uploaded (by Bartosz Dziewoński):
mw.UploadWizardDetails, mw.UploadWizardUpload: Use 'amenableparser' to handle templates in error messages

https://gerrit.wikimedia.org/r/308267

Change 308270 had a related patch set uploaded (by Bartosz Dziewoński):
mw.Upload.BookletLayout: Use 'amenableparser' to handle templates in error messages

https://gerrit.wikimedia.org/r/308270

Change 308262 merged by jenkins-bot:
mw.api.messages: Allow passing extra parameters for the API call

https://gerrit.wikimedia.org/r/308262

Change 308270 merged by jenkins-bot:
mw.Upload.BookletLayout: Use 'amenableparser' to handle templates in error messages

https://gerrit.wikimedia.org/r/308270

Change 308267 merged by jenkins-bot:
mw.UploadWizardDetails, mw.UploadWizardUpload: Use 'amenableparser' to handle templates in error messages

https://gerrit.wikimedia.org/r/308267