Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/150226

Change subject: Always set prquality even if $wgTitle does not exist
......................................................................

Always set prquality even if $wgTitle does not exist

Whenever $wgTitle is not set, the GetLinkColours hook is skip entirely.
Instead, just assume it is not in_index_namespace and produce the
prp-quality-X classes.

The parsertests would fail when run with other extensions since $wgTitle
might end up being created by some other test.

Parser tests files have NOT be changed to highlight the change.

Change-Id: I8f88b9409370eb3dbc5bbbb2727fa1e4483b8ea5
---
M ProofreadPage.body.php
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage 
refs/changes/26/150226/1

diff --git a/ProofreadPage.body.php b/ProofreadPage.body.php
index 79f4bbe..e2ced49 100644
--- a/ProofreadPage.body.php
+++ b/ProofreadPage.body.php
@@ -191,10 +191,6 @@
         * @return bool
         */
        public static function onGetLinkColours( $page_ids, &$colours ) {
-               global $wgTitle;
-               if ( !isset( $wgTitle ) ) {
-                       return true;
-               }
                self::getLinkColours( $page_ids, $colours );
                return true;
        }
@@ -208,7 +204,12 @@
                global $wgTitle;
 
                $page_namespace_id = self::getPageNamespaceId();
-               $in_index_namespace = $wgTitle->inNamespace( 
self::getIndexNamespaceId() );
+
+               if ( $wgTitle ) {
+                       $in_index_namespace = $wgTitle->inNamespace( 
self::getIndexNamespaceId() );
+               } else {
+                       $in_index_namespace = false;
+               }
 
                $values = array();
                foreach ( $page_ids as $id => $pdbk ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/150226
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f88b9409370eb3dbc5bbbb2727fa1e4483b8ea5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Hashar <has...@free.fr>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to