r73257 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73256‎ | r73257 | r73258 >
Date:23:08, 17 September 2010
Author:bharris
Status:ok (Comments)
Tags:
Comment:
Only show on view pages.
Modified paths:
  • /trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.hooks.php
@@ -46,6 +46,7 @@
4747 }
4848
4949 public static function addResources( $out ) {
 50+
5051 $title = $out->getTitle();
5152
5253 // Chances are we only want to be rating Mainspace, right?
@@ -53,6 +54,13 @@
5455 return true;
5556 }
5657
 58+ global $wgRequest;
 59+
 60+ // Only show for view actions.
 61+ if ( $wgRequest->getVal( 'action' ) !== null && $wgRequest->getVal( 'action' ) !== 'view' ) {
 62+ return true;
 63+ }
 64+
5765 global $wgArticleAssessmentCategory;
5866
5967 // check if this page should have the form

Follow-up revisions

RevisionCommit summaryAuthorDate
r73523ArticleAssessment: Per r73257 CR, use the second parameter of getVal() (defau...catrope12:58, 22 September 2010

Comments

#Comment by Nikerabbit (talk | contribs)   06:41, 18 September 2010

This should do the same thing: $wgRequest->getVal( 'action', 'view' ) !== 'view'

#Comment by Jorm (WMF) (talk | contribs)   06:46, 18 September 2010

I'd like to be able to do this without a global, so if you have any suggestions as to how that could be done, I'd love to hear them.

#Comment by Nikerabbit (talk | contribs)   07:06, 18 September 2010

Not really possible, all you could do is to move the $wgRequest call elsewhere and pass the result itself around.

Status & tagging log