Page MenuHomePhabricator

Special:Contributions without parameter should not use custom error page
Closed, ResolvedPublic2 Story Points

Description

This is the second half of T155053. Basically, the 404 error page in mobile front end has a very short HTML where the <html> tag lacks the 'lang' and 'dir' attributes, and the HTML also lacks the <meta charset...> tag. These should be added so that the 404 message is well-formed and shown correctly in RTL wikis.

This is because it invokes a 404 using wfHttpError
This should be updated to do things the MediaWiki way™

Acceptance criteria

  • Use $this->getOutput()->setStatusCode( 404 );
  • Use $this->getOutput()->addHTML
  • Show a less generic error on bad contributions link. Suggested text below

Suggested error text for contributions 404

  • Heading: Bad username given
  • Description: Cannot look for contributions without a user or with a user that does not exist.

Event Timeline

Huji created this task.Jan 12 2017, 1:28 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 12 2017, 1:28 AM
MBinder_WMF triaged this task as Normal priority.Jan 17 2017, 6:09 PM
MBinder_WMF moved this task from To Triage to Needs Analysis on the Readers-Web-Backlog board.
TheDJ added a subscriber: TheDJ.Jan 26 2017, 4:52 PM

Why is it even handling that ? Could it not just kick it back to the same error handler as we use everywhere else ?

being:
operations-mediawiki-config/errorpages/404.php

Jdlrobson renamed this task from Add `lang` and `dir` attributes to the HTML of 404 errors in mobile frontend to Special:Contributions without parameter should not use custom error page.Jan 26 2017, 9:09 PM
Jdlrobson added a project: good first bug.
Jdlrobson added a subscriber: Jdlrobson.

@TheDJ how is that used? Using $context->getOutput()->setStatusCode( 404 ) ?

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptJan 26 2017, 9:09 PM
Jdlrobson updated the task description. (Show Details)Jan 26 2017, 9:10 PM
TheDJ added a comment.Jan 28 2017, 9:49 AM

@Jdlrobson ops should know exactly, I guess.

Change 356878 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Error the official mediawiki way

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

Jdlrobson updated the task description. (Show Details)Jun 2 2017, 6:47 PM
Jdlrobson moved this task from Needs Analysis to Upcoming on the Readers-Web-Backlog board.
Jdlrobson claimed this task.Jun 7 2017, 5:03 PM

Lower priority than other stuff in sprint so moving out.

Change 356878 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Error the official mediawiki way

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

phuedx claimed this task.Jun 23 2017, 12:57 PM
phuedx added a subscriber: phuedx.

I'll sign this off as @Jdlrobson worked on it.

phuedx updated the task description. (Show Details)Jun 23 2017, 1:08 PM
phuedx closed this task as Resolved.Jun 23 2017, 1:13 PM

This is the second half of T155053. Basically, the 404 error page in mobile front end has a very short HTML where the <html> tag lacks the 'lang' and 'dir' attributes, and the HTML also lacks the <meta charset...> tag. These should be added so that the 404 message is well-formed and shown correctly in RTL wikis.

This is no longer the case on the Beta Cluster, e.g. on https://en.m.wikipedia.beta.wmflabs.org/wiki/Special:Contributions/banana the html tag has lang and dir attributes and the <meta charset="utf-8"> tag is present in the head section of the document.

This'll be deployed to group2 wikis on Monday, 26th June.

phuedx set the point value for this task to 2.Jun 23 2017, 1:16 PM

@Jdlrobson: This feels like a 2. What do you think?