# Pre-fill content with error message so that if something
# fails we'll have something telling us what we intended.
- $t = $this->getTitle()->getPrefixedText();
- $d = $oldid ? wfMsgExt( 'missingarticle-rev', array( 'escape' ), $oldid ) : '';
- $this->mContent = wfMsgNoTrans( 'missing-article', $t, $d ) ;
+ $this->mContent = wfMsgNoTrans( 'missing-revision', $oldid );
if ( $oldid ) {
# $this->mRevision might already be fetched by getOldIDFromRequest()
# Show error message
$oldid = $this->getOldID();
if ( $oldid ) {
- $text = wfMsgNoTrans( 'missing-article',
- $this->getTitle()->getPrefixedText(),
- wfMsgNoTrans( 'missingarticle-rev', $oldid ) );
+ $text = wfMsgNoTrans( 'missing-revision', $oldid );
} elseif ( $this->getTitle()->getNamespace() === NS_MEDIAWIKI ) {
// Use the default message text
$text = $this->getTitle()->getDefaultMessageText();
*
* This difers from Article::getContent() that when a missing revision is
* encountered the result will be an empty string and not the
- * 'missing-article' message.
+ * 'missing-revision' message.
*
* @since 1.19
* @return string
// Something went wrong
$wgOut->wrapWikiMsg( "<div class='errorbox'>\n$1\n</div>\n",
- array( 'missing-article', $this->mTitle->getPrefixedText(),
- wfMsgNoTrans( 'missingarticle-rev', $this->oldid ) ) );
+ array( 'missing-revision', $this->oldid ) );
}
}
}
}
}
+ private function showMissingRevision() {
+ $out = $this->getOutput();
+
+ $missing = array();
+ if ( $this->mOldRev === null ) {
+ $missing[] = $this->deletedIdMarker( $this->mOldid );
+ }
+ if ( $this->mNewRev === null ) {
+ $missing[] = $this->deletedIdMarker( $this->mNewid );
+ }
+
+ $out->setPageTitle( $this->msg( 'errorpagetitle' ) );
+ $out->addWikiMsg( 'difference-missing-revision',
+ $this->getLanguage()->listToText( $missing ), count( $missing ) );
+ }
+
function showDiffPage( $diffOnly = false ) {
wfProfileIn( __METHOD__ );
$out->setRobotPolicy( 'noindex,nofollow' );
if ( !$this->loadRevisionData() ) {
- // Sounds like a deleted revision... Let's see what we can do.
- $t = $this->getTitle()->getPrefixedText();
- $d = $this->msg( 'missingarticle-diff',
- $this->deletedIdMarker( $this->mOldid ),
- $this->deletedIdMarker( $this->mNewid ) )->escaped();
- $out->setPageTitle( $this->msg( 'errorpagetitle' ) );
- $out->addWikiMsg( 'missing-article', "<nowiki>$t</nowiki>", "<span class='plainlinks'>$d</span>" );
+ $this->showMissingRevision();
wfProfileOut( __METHOD__ );
return;
}
function showDiff( $otitle, $ntitle, $notice = '' ) {
$diff = $this->getDiff( $otitle, $ntitle, $notice );
if ( $diff === false ) {
- $this->getOutput()->addWikiMsg( 'missing-article', "<nowiki>(fixme, bug)</nowiki>", '' );
+ $this->showMissingRevision();
return false;
} else {
$this->showDiffStyle();
You can [[Special:Search/{{PAGENAME}}|search for this page title]] in other pages,
or <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} search the related logs]</span>.',
'noarticletextanon' => '{{int:noarticletext}}', # do not translate or duplicate this message to other languages
+'missing-revision' => 'The revision #$1 of the page named "{{PAGENAME}}" does not exist.
+
+This is usually caused by following an outdated history link to a page that has been deleted.
+Details can be found in the [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} deletion log].',
'userpage-userdoesnotexist' => 'User account "$1" is not registered.
Please check if you want to create/edit this page.',
'userpage-userdoesnotexist-view' => 'User account "$1" is not registered.',
'mergelogpagetext' => 'Below is a list of the most recent merges of one page history into another.',
# Diffs
-'history-title' => 'Revision history of "$1"',
-'difference-title' => 'Difference between revisions of "$1"',
-'difference-title-multipage' => 'Difference between pages "$1" and "$2"',
-'difference-multipage' => '(Difference between pages)',
-'lineno' => 'Line $1:',
-'compareselectedversions' => 'Compare selected revisions',
-'showhideselectedversions' => 'Show/hide selected revisions',
-'editundo' => 'undo',
-'diff-multi' => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} by {{PLURAL:$2|one user|$2 users}} not shown)',
-'diff-multi-manyusers' => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} by more than $2 {{PLURAL:$2|user|users}} not shown)',
+'history-title' => 'Revision history of "$1"',
+'difference-title' => 'Difference between revisions of "$1"',
+'difference-title-multipage' => 'Difference between pages "$1" and "$2"',
+'difference-multipage' => '(Difference between pages)',
+'lineno' => 'Line $1:',
+'compareselectedversions' => 'Compare selected revisions',
+'showhideselectedversions' => 'Show/hide selected revisions',
+'editundo' => 'undo',
+'diff-multi' => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} by {{PLURAL:$2|one user|$2 users}} not shown)',
+'diff-multi-manyusers' => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} by more than $2 {{PLURAL:$2|user|users}} not shown)',
+'difference-missing-revision' => '{{PLURAL:$2|One revision|$2 revisions}} of this difference ($1) {{PLURAL:$2|was|were}} not found.
+
+This is usually caused by following an outdated diff link to a page that has been deleted.
+Details can be found in the [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} deletion log].',
# Search results
'search-summary' => '', # do not translate or duplicate this message to other languages
See also {{msg-mw|Noarticletext-nopermission}}.',
'noarticletext-nopermission' => 'See also {{msg-mw|Noarticletext}}.',
+'missing-revision' => 'Text displayed when the requested revision does not exist using a permalink.
+
+Example: [http://translatewiki.net/w/i.php?title=Project:News&oldid=9999999 Permalink with invalid revision#]
+
+* $1 is the ID of the missing revision',
'userpage-userdoesnotexist' => 'Error message displayed when trying to edit or create a page or a subpage that belongs to a user who is not registered on the wiki. Parameters:
* $1 is a possible username that has not been registered.',
'userpage-userdoesnotexist-view' => 'Shown in user pages of non existing users. See for example [http://translatewiki.net/wiki/User:Foo User:Foo]. Parameters:
'diff-multi-manyusers' => "This message appears in the revision history of a page when comparing two versions which aren't consecutive, and the intermediate revisions have been edited by more than 100 users. Parameters:
* $1 is the number of revisions, will always be 101 or more.
* $2 is the number of users that were found, which was limited at 100.",
+'difference-missing-revision' => 'Text displayed when the requested revision does not exist using a diff link.
+
+Example: [http://translatewiki.net/w/i.php?title=Project:News&diff=426850&oldid=99999999 Diff with invalid revision#]
+
+* $1 is the list of missing revisions IDs
+* $2 is the number of items in $1',
# Search results
'searchresults' => '{{Identical|Search results}}',
'readonly',
'enterlockreason',
'readonlytext',
- 'missing-article',
- 'missingarticle-rev',
- 'missingarticle-diff',
+ 'missing-article', // not used anymore in core, but kept for extensions
+ 'missingarticle-rev', // not used anymore in core, but kept for extensions
+ 'missingarticle-diff', // not used anymore in core, but kept for extensions
'readonly_lag',
'internalerror',
'internalerror_info',
'noarticletext',
'noarticletext-nopermission',
'noarticletextanon',
+ 'missing-revision',
'userpage-userdoesnotexist',
'userpage-userdoesnotexist-view',
'blocked-notice-logextract',
'editundo',
'diff-multi',
'diff-multi-manyusers',
+ 'difference-missing-revision',
),
'search' => array(
'search-summary',