Page MenuHomePhabricator

Improve appearance of Special:MobileDiff when looking for invalid revision (Maybe because it's deleted)
Open, HighPublic5 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

Related Objects

StatusAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenNone
ResolvedAbit
OpenNone
OpenNone
OpenNone
OpenNone
DuplicateNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedppelberg
ResolvedKrinkle
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
StalledNone
ResolvedPetrb
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone

Event Timeline

Ammarpad created this task.May 27 2019, 3:32 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 27 2019, 3:32 PM
ovasileva triaged this task as High priority.May 29 2019, 4:55 PM
pmiazga updated the task description. (Show Details)Jun 4 2019, 1:55 PM
pmiazga moved this task from Needs Prioritization to Upcoming on the Readers-Web-Backlog board.
pmiazga updated the task description. (Show Details)Jun 4 2019, 4:36 PM
ovasileva set the point value for this task to 5.Jun 4 2019, 4:42 PM
pmiazga added a subscriber: pmiazga.Jun 4 2019, 4:44 PM
This comment was removed by pmiazga.
pmiazga updated the task description. (Show Details)Jun 4 2019, 4:47 PM
Ammarpad updated the task description. (Show Details)Jun 5 2019, 11:05 AM
Ammarpad updated the task description. (Show Details)