r55979 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55978‎ | r55979 | r55980 >
Date:16:21, 7 September 2009
Author:churchofemacs
Status:ok (Comments)
Tags:
Comment:
New message noarticletext-nopermission that does not include misleading link 'edit this page' if user is not allowed to create the page.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -537,6 +537,7 @@
538538 'talkpagetext',
539539 'anontalkpagetext',
540540 'noarticletext',
 541+ 'noarticletext-nopermission',
541542 'noarticletextanon',
542543 'userpage-userdoesnotexist',
543544 'clearyourcache',
Index: trunk/phase3/includes/Article.php
@@ -1213,7 +1213,10 @@
12141214 // Use the default message text
12151215 $text = $this->getContent();
12161216 } else {
1217 - $text = wfMsgNoTrans( 'noarticletext' );
 1217+ if ( $this->mTitle->userCan( 'edit' ) )
 1218+ $text = wfMsgNoTrans( 'noarticletext' );
 1219+ else
 1220+ $text = wfMsgNoTrans( 'noarticletext-nopermission' );
12181221 }
12191222 $text = "<div class='noarticletext'>\n$text\n</div>";
12201223 if( !$this->hasViewableContent() ) {
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1247,6 +1247,9 @@
12481248 You can [[Special:Search/{{PAGENAME}}|search for this page title]] in other pages,
12491249 <span class="plainlinks">[{{fullurl:Special:Log|page={{urlencode:{{FULLPAGENAME}}}}}} search the related logs],
12501250 or [{{fullurl:{{FULLPAGENAME}}|action=edit}} edit this page]</span>.',
 1251+'noarticletext-nopermission' => 'There is currently no text in this page.
 1252+You can [[Special:Search/{{PAGENAME}}|search for this page title]] in other pages,
 1253+or <span class="plainlinks">[{{fullurl:Special:Log|page={{urlencode:{{FULLPAGENAME}}}}}} search the related logs]</span>.',
12511254 'noarticletextanon' => '{{int:noarticletext}}', # do not translate or duplicate this message to other languages
12521255 'userpage-userdoesnotexist' => 'User account "$1" is not registered.
12531256 Please check if you want to create/edit this page.',
Index: trunk/phase3/RELEASE-NOTES
@@ -467,6 +467,8 @@
468468 argument
469469 * (bug 20136) Protection form JavaScript now synchronizes the expiry boxes on
470470 any change, in addition to onkeyup.
 471+* Don't link to "edit this page" on MediaWiki:Noarticletext if user is not allowed
 472+ to create page. Done via new message MediaWiki:Noarticletext-nopermission
471473
472474 == API changes in 1.16 ==
473475

Follow-up revisions

RevisionCommit summaryAuthorDate
r56062Fixes for r55979...werdna19:39, 8 September 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   19:31, 8 September 2009

This doesn't seem to catch the case where a page is title-protected. Should this check for 'create' rather than 'edit'?

#Comment by Church of emacs (talk | contribs)   19:44, 8 September 2009

Fixed by werdna in r56062.

Status & tagging log