r88589 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88588‎ | r88589 | r88590 >
Date:18:00, 22 May 2011
Author:demon
Status:ok
Tags:
Comment:
Followup r88588 ($wgArticle fixes)
* Remove $wgArticle from a bunch of comments in extensions
* Minor cleanup to LQT to remove some globals (or shift them up into the SpecialPage and out of the LqtView). Mainly so I could kill $wgArticle
** Same thing in Multilingual.
* Known offenders still: MetavidWiki, AbuseFilter (bug 29092)
Modified paths:
  • /trunk/extensions/FlaggedRevs/presentation/FlaggedPageView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php (modified) (history)
  • /trunk/extensions/LiquidThreads/classes/View.php (modified) (history)
  • /trunk/extensions/LiquidThreads/pages/SpecialHotTopics.php (modified) (history)
  • /trunk/extensions/MultilingualLiquidThreads/LiquidThreads/classes/View.php (modified) (history)
  • /trunk/extensions/MultilingualLiquidThreads/LiquidThreads/pages/SpecialHotTopics.php (modified) (history)
  • /trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/View.php
@@ -37,11 +37,6 @@
3838 $this->user_color_index = 1;
3939 }
4040
41 - static function getView() {
42 - global $wgOut, $wgArticle, $wgTitle, $wgUser, $wgRequest;
43 - return new LqtView( $wgOut, $wgArticle, $wgTitle, $wgUser, $wgRequest );
44 - }
45 -
4641 function setHeaderLevel( $int ) {
4742 $this->headerLevel = $int;
4843 }
Index: trunk/extensions/LiquidThreads/pages/SpecialHotTopics.php
@@ -5,12 +5,13 @@
66 }
77
88 function execute( $par ) {
9 - global $wgOut;
 9+ global $wgOut, $wgUser, $wgRequest;
1010
1111 $this->setHeaders();
1212
1313 $wgOut->setPageTitle( wfMsg( 'lqt-hot-topics' ) );
14 - $view = LqtView::getView();
 14+ $title = $this->getTitle();
 15+ $view = new LqtView( $wgOut, new Article( $title ), $title, $wgUser, $wgRequest );
1516
1617 // Get hot topics
1718 $topics = LqtHotTopicsController::getHotThreads();
Index: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php
@@ -310,7 +310,7 @@
311311 * Injects handling of the 'feed' action.
312312 * Usage: $wgHooks['UnknownAction'][] = 'wfWikiArticleFeedsAction';
313313 * @param $action Handle to an action string (presumably same as global $action).
314 - * @param $article Article to be converted to rss or atom feed (presumably same as $wgArticle).
 314+ * @param $article Article to be converted to rss or atom feed
315315 */
316316 function wfWikiArticleFeedsAction( $action, $article ) {
317317
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php
@@ -219,7 +219,6 @@
220220 // *sigh*...skip, dealt with in setNavigation()
221221 return true;
222222 }
223 - // Note: $wgArticle sometimes not set here
224223 if ( FlaggedPageView::globalArticleInstance() != null ) {
225224 $view = FlaggedPageView::singleton();
226225 $view->setActionTabs( $skin, $contentActions );
@@ -230,7 +229,6 @@
231230
232231 // Vector et al: $links is all the tabs (2 levels)
233232 public static function onSkinTemplateNavigation( Skin $skin, array &$links ) {
234 - // Note: $wgArticle sometimes not set here
235233 if ( FlaggedPageView::globalArticleInstance() != null ) {
236234 $view = FlaggedPageView::singleton();
237235 $view->setActionTabs( $skin, $links['actions'] );
@@ -579,7 +577,6 @@
580578 }
581579
582580 public static function injectPostEditURLParams( $article, &$sectionAnchor, &$extraQuery ) {
583 - // Note: $wgArticle sometimes not set here
584581 if ( FlaggedPageView::globalArticleInstance() != null ) {
585582 $view = FlaggedPageView::singleton();
586583 $view->injectPostEditURLParams( $sectionAnchor, $extraQuery );
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedPageView.php
@@ -55,7 +55,7 @@
5656 }
5757
5858 /**
59 - * Get the FlaggedPage instance associated with $wgArticle/$wgTitle,
 59+ * Get the FlaggedPage instance associated with $wgTitle,
6060 * or false if there isn't such a title
6161 */
6262 public static function globalArticleInstance() {
Index: trunk/extensions/MultilingualLiquidThreads/LiquidThreads/classes/View.php
@@ -37,11 +37,6 @@
3838 $this->user_color_index = 1;
3939 }
4040
41 - static function getView() {
42 - global $wgOut, $wgArticle, $wgTitle, $wgUser, $wgRequest;
43 - return new LqtView( $wgOut, $wgArticle, $wgTitle, $wgUser, $wgRequest );
44 - }
45 -
4641 function setHeaderLevel( $int ) {
4742 $this->headerLevel = $int;
4843 }
Index: trunk/extensions/MultilingualLiquidThreads/LiquidThreads/pages/SpecialHotTopics.php
@@ -5,12 +5,13 @@
66 }
77
88 function execute( $par ) {
9 - global $wgOut;
 9+ global $wgOut, $wgUser, $wgRequest;
1010
1111 $this->setHeaders();
1212
1313 $wgOut->setPageTitle( wfMsg( 'lqt-hot-topics' ) );
14 - $view = LqtView::getView();
 14+ $title = $this->getTitle();
 15+ $view = new LqtView( $wgOut, new Article( $title ), $title, $wgUser, $wgRequest );
1516
1617 LqtView::addJsAndCss();
1718

Follow-up revisions

RevisionCommit summaryAuthorDate
r102497* (bug 29092) Removed usage of $wgArticle from AbuseFilter extension...ialex08:36, 9 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88588$wgArticle is deprecated! Possible removal in 1.20 or 1.21!...demon17:59, 22 May 2011

Status & tagging log