Thcipriani has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/374882 )

Change subject: Avoids a stack overflow
......................................................................

Avoids a stack overflow

The cause of this error is that CustomIndexFieldsParser
setup by the context relies on the ContentHandler system
and the ContentHandler default model hook relies on Context.

Bug: T173520
Change-Id: Ibe065a8df9e7fa49b85a789b59f3d3569a87eb8a
---
M ProofreadPage.body.php
1 file changed, 4 insertions(+), 2 deletions(-)


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

diff --git a/ProofreadPage.body.php b/ProofreadPage.body.php
index 56b01ed..dbae3ab 100644
--- a/ProofreadPage.body.php
+++ b/ProofreadPage.body.php
@@ -25,6 +25,7 @@
 use ProofreadPage\Page\PageContent;
 use ProofreadPage\Page\PageContentBuilder;
 use ProofreadPage\Pagination\PageNotInPaginationException;
+use ProofreadPage\ProofreadPageInit;
 
 /*
  @todo :
@@ -41,7 +42,7 @@
         * @return int
         */
        public static function getPageNamespaceId() {
-               return Context::getDefaultContext()->getPageNamespaceId();
+               return ProofreadPageInit::getNamespaceId( 'page' );
        }
 
        /**
@@ -52,7 +53,7 @@
         * @return int
         */
        public static function getIndexNamespaceId() {
-               return Context::getDefaultContext()->getIndexNamespaceId();
+               return ProofreadPageInit::getNamespaceId( 'index' );
        }
 
        /**
@@ -89,6 +90,7 @@
         * @return bool if we have to continue the research for a content 
handler
         */
        public static function onContentHandlerDefaultModelFor( Title $title, 
&$model ) {
+               // Warning: do not use Context here because it assumes 
ContentHandler is already initialized
                if ( $title->inNamespace( self::getPageNamespaceId() ) ) {
                        $model = CONTENT_MODEL_PROOFREAD_PAGE;
                        return false;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe065a8df9e7fa49b85a789b59f3d3569a87eb8a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: wmf/1.30.0-wmf.16
Gerrit-Owner: Thcipriani <tcipri...@wikimedia.org>
Gerrit-Reviewer: Tpt <thoma...@hotmail.fr>

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

Reply via email to