r71541 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71540‎ | r71541 | r71542 >
Date:01:37, 24 August 2010
Author:reedy
Status:deferred
Tags:
Comment:
Followup r71540

Add $skin to calls of SkinAfterContent hook

Kill the uses of $wgTitle there
Modified paths:
  • /trunk/extensions/AjaxLogin/AjaxLogin.php (modified) (history)
  • /trunk/extensions/ReaderFeedback/ReaderFeedback.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AjaxLogin/AjaxLogin.php
@@ -94,12 +94,12 @@
9595 * @param $data The data, AjaxLogin form in this case, to be added to the HTML output of a page
9696 * @return true
9797 */
98 -function GetAjaxLoginForm( &$data ) {
99 - global $wgAuth, $wgEnableEmail, $wgOut, $wgTitle, $wgUser;
 98+function GetAjaxLoginForm( &$data, $skin ) {
 99+ global $wgAuth, $wgEnableEmail, $wgOut, $wgUser;
100100 global $wgEnableAjaxLogin;
101101 if (
102102 isset( $wgEnableAjaxLogin ) && $wgUser->isAnon() &&
103 - $wgTitle->getNamespace() != 8 && !$wgTitle->isSpecial( 'Userlogin' )
 103+ $skin->getTitle()->getNamespace() != 8 && !$skin->getTitle()->isSpecial( 'Userlogin' )
104104 ) {
105105 $titleObj = SpecialPage::getTitleFor( 'Userlogin' );
106106 $link = $titleObj->getLocalURL( 'type=signup' );
Index: trunk/extensions/ReaderFeedback/ReaderFeedback.hooks.php
@@ -72,11 +72,12 @@
7373 return ( $action == 'view' || $action == 'purge' || $action == 'render' );
7474 }
7575
76 - public static function addFeedbackForm( &$data ) {
77 - global $wgOut, $wgArticle, $wgTitle;
 76+ public static function addFeedbackForm( &$data, $skin ) {
 77+ global $wgOut, $wgArticle
 78+ $title = $skin->getTitle();
7879 if( $wgOut->isArticleRelated() && isset($wgArticle) ) {
7980 global $wgRequest, $wgUser, $wgOut;
80 - if( !$wgTitle->exists() || !ReaderFeedback::isPageRateable($wgTitle) || !$wgOut->getRevisionId() ) {
 81+ if( !$title->exists() || !ReaderFeedback::isPageRateable($title) || !$wgOut->getRevisionId() ) {
8182 return true;
8283 }
8384 # Check action and if page is protected
@@ -92,8 +93,8 @@
9394 }
9495 # If the user already voted, then don't show the form.
9596 # Always show for IPs however, due to squid caching...
96 - if( !$wgUser->getId() || !ReaderFeedbackPage::userAlreadyVoted( $wgTitle, $id ) ) {
97 - self::addQuickFeedback( $data, false, $wgTitle );
 97+ if( !$wgUser->getId() || !ReaderFeedbackPage::userAlreadyVoted( $title, $id ) ) {
 98+ self::addQuickFeedback( $data, false, $title );
9899 }
99100 }
100101 return true;

Follow-up revisions

RevisionCommit summaryAuthorDate
r71992Fixed fatal from r71541aaron23:27, 30 August 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r71540Update SkinAfterContent hook to pass the current skin too...reedy01:31, 24 August 2010

Status & tagging log