Page MenuHomePhabricator

Improve appearance of Special:MobileDiff when looking for invalid revision (Maybe because it's deleted)
Closed, ResolvedPublic5 Estimated Story Points

Description

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."

QA results

T224430#5722992

Related Objects

StatusSubtypeAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenFeatureNone
OpenBUG REPORTNone
OpenNone
StalledNone
OpenFeatureNone
DuplicateNone
ResolvedNone
OpenNone
OpenNone
OpenFeatureNone
OpenNone
ResolvedNone
ResolvedNone
OpenFeatureNone
OpenNone
ResolvedHalfak
OpenNone
OpenNone
OpenFeatureNone
StalledNone
OpenNone
OpenNone
OpenNone
ResolvedPetrb
OpenNone
OpenNone
Resolvedtstarling
OpenNone
DeclinedNone
ResolvedBUG REPORTJdlrobson
ResolvedNone
ResolvedAmmarpad

Event Timeline

ovasileva set the point value for this task to 5.Jun 4 2019, 4:42 PM
This comment was removed by pmiazga.
Ammarpad updated the task description. (Show Details)

Change 553837 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/extensions/MobileFrontend@master] Show a nice error message for invalid revisions

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

Niedzielski updated the task description. (Show Details)

@ovasileva, I've merged @Ammarpad's nice patch. It looked low risk, was a solid improvement, and the patch was ready and waiting. As the patch is now merged, I'm moving this into the kanban board for testing by @Edtadros.

Change 553837 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Show a nice error message for invalid revisions

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

QA

  1. Visit https://en.m.wikipedia.beta.wmflabs.org/wiki/Special:MobileDiff/898964501898964501
  2. 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."

Screen Shot 2019-12-09 at 11.58.10 AM.png (986×2 px, 148 KB)

message appears as expected, moving to signoff