r58021 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58020‎ | r58021 | r58022 >
Date:16:39, 22 October 2009
Author:raymond
Status:ok (Comments)
Tags:
Comment:
* (bug 21047) Wrap 'cannotdelete' into a div with the generic 'error' class and an own 'mw-error-cannotdelete' class
Based on a patch by Platonides
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -2557,7 +2557,13 @@
25582558 $conds = $this->mTitle->pageCond();
25592559 $latest = $dbw->selectField( 'page', 'page_latest', $conds, __METHOD__ );
25602560 if( $latest === false ) {
2561 - $wgOut->showFatalError( wfMsgExt( 'cannotdelete', array( 'parse' ) ) );
 2561+ $wgOut->showFatalError(
 2562+ Html::rawElement(
 2563+ 'div',
 2564+ array( 'class' => 'error mw-error-cannotdelete' ),
 2565+ wfMsgExt( 'cannotdelete', array( 'parse' ), $this->mTitle->getPrefixedText() )
 2566+ )
 2567+ );
25622568 $wgOut->addHTML( Xml::element( 'h2', null, LogPage::logName( 'delete' ) ) );
25632569 LogEventsList::showLogExtract(
25642570 $wgOut,
@@ -2801,7 +2807,13 @@
28022808 }
28032809 } else {
28042810 if( $error == '' ) {
2805 - $wgOut->showFatalError( wfMsgExt( 'cannotdelete', array( 'parse' ) ) );
 2811+ $wgOut->showFatalError(
 2812+ Html::rawElement(
 2813+ 'div',
 2814+ array( 'class' => 'error mw-error-cannotdelete' ),
 2815+ wfMsgExt( 'cannotdelete', array( 'parse' ), $this->mTitle->getPrefixedText() )
 2816+ )
 2817+ );
28062818 $wgOut->addHTML( Xml::element( 'h2', null, LogPage::logName( 'delete' ) ) );
28072819 LogEventsList::showLogExtract(
28082820 $wgOut,
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -991,7 +991,7 @@
992992 'unexpected' => 'Unexpected value: "$1"="$2".',
993993 'formerror' => 'Error: could not submit form',
994994 'badarticleerror' => 'This action cannot be performed on this page.',
995 -'cannotdelete' => 'Could not delete the page or file specified.
 995+'cannotdelete' => 'The page or file "$1" could not be deleted.
996996 It may have already been deleted by someone else.',
997997 'badtitle' => 'Bad title',
998998 'badtitletext' => 'The requested page title was invalid, empty, or an incorrectly linked inter-language or inter-wiki title.
Index: trunk/phase3/RELEASE-NOTES
@@ -256,6 +256,8 @@
257257 rate limits.
258258 * (bug 21222) When $wgUseTeX is not enabled, <math> is no longer registered with
259259 the parser so extensions are free to implement their own <math> tag
 260+* (bug 21047) Wrap 'cannotdelete' into a div with the generic 'error' class and
 261+ an own 'mw-error-cannotdelete' class
260262
261263 === Bug fixes in 1.16 ===
262264

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r57897* (bug 21047) Wrap "cannotdelete" message into a div with the generic 'error'...raymond16:43, 19 October 2009

Comments

#Comment by Platonides (talk | contribs)   16:42, 22 October 2009

In the original patch, mw-error-cannotdelete was an id, not a class. Any special reason to have it as a class?

#Comment by Platonides (talk | contribs)   17:07, 22 October 2009

Raymond_ answer: they are usually classes.

I don't think we will ever get several cannotdelete errors in a page. Having if (document.getElementById('mw-error-cannotdelete')) looks nicer than if (document.getElementsByClassName('mw-error-cannotdelete').length > 0)

#Comment by Nikerabbit (talk | contribs)   17:39, 22 October 2009

Not a problem once jQuery is usable.

Status & tagging log