r110896 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110895‎ | r110896 | r110897 >
Date:23:45, 7 February 2012
Author:bsitu
Status:ok
Tags:
Comment:
followup to -r110866 - place the hook after $text generation so extension can overwrite it, this makes code more clear
Modified paths:
  • /branches/ArticleCreationWorkflow/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: branches/ArticleCreationWorkflow/phase3/includes/Article.php
@@ -1004,14 +1004,12 @@
10051005 $editErrors = $this->getTitle()->getUserPermissionsErrors( 'edit', $wgUser );
10061006 $errors = array_merge( $createErrors, $editErrors );
10071007
1008 - wfRunHooks( 'BeforeDisplayNoArticleText', array( $this, &$text, $errors, $wgUser, &$wikiText ) );
1009 - if ( !$text ) {
1010 - if ( !count( $errors ) ) {
1011 - $text = wfMsgNoTrans( 'noarticletext' );
1012 - } else {
1013 - $text = wfMsgNoTrans( 'noarticletext-nopermission' );
1014 - }
 1008+ if ( !count( $errors ) ) {
 1009+ $text = wfMsgNoTrans( 'noarticletext' );
 1010+ } else {
 1011+ $text = wfMsgNoTrans( 'noarticletext-nopermission' );
10151012 }
 1013+ wfRunHooks( 'BeforeDisplayNoArticleText', array( $this, &$text, $errors, $wgUser, &$wikiText ) );
10161014 }
10171015 $text = "<div class='noarticletext'>\n$text\n</div>";
10181016

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r110866Adding a new hook - BeforeDisplayNoArticleText to core at /branches/ArticleCr...bsitu19:47, 7 February 2012

Status & tagging log