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

Change subject: Replaced "Revision::getText()" depracated in MediaWiki 1.21
......................................................................

Replaced "Revision::getText()" depracated in MediaWiki 1.21

"Revision::getText()" is deprecated in MediaWiki 1.21. Replaced usage

Bug: T151973
Change-Id: Ia822612602ce06cc915e339e02f2bd66e3ff433b
---
M JsonData_body.php
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/JsonData 
refs/changes/24/326524/1

diff --git a/JsonData_body.php b/JsonData_body.php
index 5343435..c09f842 100644
--- a/JsonData_body.php
+++ b/JsonData_body.php
@@ -141,20 +141,21 @@
        }
 
        /*
-        * Load appropriate editor text into the object (if it hasn't been 
yet), 
+        * Load appropriate editor text into the object (if it hasn't been yet),
         * and return it.  This will either be the contents of the title being
         * viewed, or it will be the newly-edited text being previewed.
         */
        public function getEditorText() {
                if( is_null( $this->editortext ) ) {
-                       // on preview, pull $editortext out from the submitted 
text, so 
+                       // on preview, pull $editortext out from the submitted 
text, so
                        // that the author can change schemas during preview
                        $this->editortext = $this->out->getRequest()->getText( 
'wpTextbox1' );
                        // wpTextbox1 is empty in normal editing, so pull it 
from article->getText() instead
                        if ( empty( $this->editortext ) ) {
                                $rev = Revision::newFromTitle( $this->title );
                                if( is_object( $rev ) ) {
-                                       $this->editortext = $rev->getText();
+                                       $content = $rev->getContent();
+                                       $this->editortext = 
ContentHandler::getContentText( $content );
                                }
                                else {
                                        $this->editortext = "";
@@ -284,7 +285,7 @@
        }
 
        /*
-        *  Parse the article/editor text as well as the corresponding schema 
text, 
+        *  Parse the article/editor text as well as the corresponding schema 
text,
         *  and load the result into an object (JsonTreeRef) that associates
         *  each JSON node with its corresponding schema node.
         */
@@ -312,7 +313,8 @@
                        return "";
                }
                else {
-                       $revtext = $rev->getText();
+                       $content = $rev->getContent();
+                       $revtext = ContentHandler::getContentText( $contet );
                        return preg_replace( array( '/^<[\w]+[^>]*>/m', 
'/<\/[\w]+>$/m' ), array( "", "" ), $revtext );
                }
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia822612602ce06cc915e339e02f2bd66e3ff433b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/JsonData
Gerrit-Branch: master
Gerrit-Owner: Filip <r...@protonmail.com>

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

Reply via email to