When you click a link to deleted (or just nonexistent) revision on the web, MediaWiki:Difference-missing-revision is shown which explains what happened.
But when you click the same link in mobile view, it shows unhelpful plain error message:
Bad revision. The ID for the revision you requested does not exist.
Developer notes
The problem is located in SpecialMobileDiff::executeWhenAvailable() function. When $rev is null (no revision found), instead of normal flow system calls
wfHttpError( 404, title, text ); and returns early. wfHttpError function returns the error in oldchool/ugly way without any layout (as it says, it's simple http errror.
Code:
public function executeWhenAvailable( $par ) { [...] $revisions = $this->getRevisionsToCompare( explode( '...', $par, 2 ) ); list( $prev, $rev ) = $revisions; if ( $rev === null ) { $this->executeBadQuery(); return false; } [...] } /** * Generate a 404 Error message, that revisions can not be found */ public function executeBadQuery() { wfHttpError( 404, $this->msg( 'mobile-frontend-diffview-404-title' )->text(), $this->msg( 'mobile-frontend-diffview-404-desc' )->text() ); }
Instead please use $this->showPageNotFound(). TheSpecialMobileDiff should override errorNotFoundDescriptionMsg and errorNotFoundTitleMsg properties.
Acceptance criteria
- When $revision is not found system outputs nice error page
- wfHttpError() is not used
QA
Visit https://en.m.wikipedia.beta.wmflabs.org/wiki/Special:MobileDiff/898964501898964501
This should show a friendly error message in the Minerva skin. It should not show a blank white page with the text "The ID for the revision you requested does not exist."