(Bug 44357) Update checkStorage.php to not use deprecated Revision::getText()
authorPlatonides <platonides@gmail.com>
Sat, 26 Jan 2013 14:36:54 +0000 (15:36 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 25 Apr 2013 17:34:51 +0000 (17:34 +0000)
Change-Id: Id632867207960ba5c25d2b6eaba06f051fb1e681

maintenance/storage/checkStorage.php

index b9bfe81..505313d 100644 (file)
@@ -443,13 +443,21 @@ class CheckStorage {
 
        function importRevision( &$revision, &$importer ) {
                $id = $revision->getID();
-               $text = $revision->getText();
+               $content = $revision->getContent( Revision::RAW );
+               $id = $id ? $id : '';
+
+               if ( $content === null ) {
+                       echo "Revision $id is broken, we have no content available\n";
+                       return;
+               }
+
+               $text = $content->serialize();
                if ( $text === '' ) {
                        // This is what happens if the revision was broken at the time the
                        // dump was made. Unfortunately, it also happens if the revision was
                        // legitimately blank, so there's no way to tell the difference. To
                        // be safe, we'll skip it and leave it broken
-                       $id = $id ? $id : '';
+
                        echo "Revision $id is blank in the dump, may have been broken before export\n";
                        return;
                }