Page MenuHomePhabricator

{{FULLPAGENAME}} returns "Special:Badtitle/ApiErrorFormatter::getDummyTitle" in abusefilter warning with VE
Open, Needs TriagePublic


Steps to reproduce:

  1. Create an abusefilter with disallowed message "MediaWiki:Abusefilter-disallowed-foo".
  2. Create "MediaWiki:Abusefilter-disallowed-foo" with "{{FULLPAGENAME}}". (example)
  3. Edit a page with VE.
  4. Try to trigger the abusefilter.
  5. And you will see {{FULLPAGENAME}} is rendered as Special:Badtitle/ApiErrorFormatter::getDummyTitle.

zh:MediaWiki:Abusefilter-disallowed-trigger is rendered as:

Event Timeline

Xiplus created this task.Mar 14 2020, 1:10 PM
Restricted Application added subscribers: Liuxinyu970226, Cosine02, Aklapper. · View Herald TranscriptMar 14 2020, 1:10 PM

The same problem affects action=edit and probably other API modules. There is currently no way to specify the title in context of which error messages should be rendered.

@Anomie Do you have any advice as to what is the best way to put a different title inside the ApiErrorFormatter? I see a few possible ways to do it but I thought I'd ask since you might have already considered this in the past.

Anomie moved this task from Unsorted to Needs details or plan on the MediaWiki-API board.

Depending on the module, there may not even be a title that could sensibly be used. For example, action=query is often used to process many titles, and action=abusefilterevalexpression doesn't have any title specified.

But for things like ApiEditPage where it is specifically operating on just one title, I could see ApiEditPage::execute() making a method call to "register" that title once it has determined it. Probably I'd do an ApiBase or ApiMain method so it can set the title in the DerivativeContext returned by $this->getContext() too. Does that sound like it would work for your use case?

Restricted Application edited projects, added Core Platform Team; removed Core Platform Team (Icebox). · View Herald TranscriptJun 2 2020, 8:58 PM