Tpt has uploaded a new change for review.

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

Change subject: Removes backcompatibility code
......................................................................

Removes backcompatibility code

Not useful anymore as this extension is lready not working with MW version < 
1.25

Change-Id: I2a5ce1cb63f4e9aa47e3595f24d9b9c8e42c10f3
---
M ApiQueryProofread.php
M ApiQueryProofreadInfo.php
M ProofreadPage.body.php
3 files changed, 12 insertions(+), 69 deletions(-)


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

diff --git a/ApiQueryProofread.php b/ApiQueryProofread.php
index 45ad0b2..81ba545 100644
--- a/ApiQueryProofread.php
+++ b/ApiQueryProofread.php
@@ -64,15 +64,10 @@
 
                $api = new ApiMain( $params );
                $api->execute();
-               if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                       $data = $api->getResult()->getResultData();
-                       $pages = ApiResult::stripMetadataNonRecursive(
-                               (array)$data['query']['pages']
-                       );
-               } else {
-                       $data = $api->getResultData();
-                       $pages = $data['query']['pages'];
-               }
+               $data = $api->getResult()->getResultData();
+               $pages = ApiResult::stripMetadataNonRecursive(
+                       (array)$data['query']['pages']
+               );
                unset( $api );
 
                if ( array_key_exists( 'error', $data ) ) {
@@ -105,22 +100,6 @@
 
        public function getAllowedParams() {
                return [];
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getDescription() {
-               return 'Returns information about the current proofread status 
of the given pages.';
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getExamples() {
-               return [
-                       'api.php?action=query&generator=allpages&gapnamespace=' 
. ProofreadPage::getPageNamespaceId() . '&prop=proofread'
-               ];
        }
 
        /**
diff --git a/ApiQueryProofreadInfo.php b/ApiQueryProofreadInfo.php
index 1184379..0d8d81e 100644
--- a/ApiQueryProofreadInfo.php
+++ b/ApiQueryProofreadInfo.php
@@ -87,37 +87,6 @@
        }
 
        /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getParamDescription() {
-               return [
-                       'prop' => [
-                               'Which proofread properties to get:',
-                               ' namespaces            - Information about 
Page and Index namespaces',
-                               ' qualitylevels         - List of proofread 
quality levels'
-                       ]
-               ];
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getDescription() {
-               return 'Return information about configuration of ProofreadPage 
extension';
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getExamples() {
-               return [
-                       'api.php?action=query&meta=proofreadinfo',
-                       
'api.php?action=query&meta=proofreadinfo&piprop=namespaces|qualitylevels',
-                       
'api.php?action=query&meta=proofreadinfo&piprop=namespaces',
-               ];
-       }
-
-       /**
         * @see ApiBase::getExamplesMessages()
         */
        protected function getExamplesMessages() {
diff --git a/ProofreadPage.body.php b/ProofreadPage.body.php
index 3b51d76..6c3b8e1 100644
--- a/ProofreadPage.body.php
+++ b/ProofreadPage.body.php
@@ -448,7 +448,7 @@
         */
        public static function updatePrIndex( $index, $deletedPage = null ) {
                $indexTitle = $index->getTitle();
-               $indexId = $index->getID();
+               $indexId = $index->getId();
 
                // read the list of pages
                $pages = [];
@@ -457,7 +457,7 @@
                );
                foreach ( $pagination as $page ) {
                        if ( $deletedPage === null || 
!$page->getTitle()->equals( $deletedPage ) ) {
-                               array_push( $pages, 
$page->getTitle()->getDBKey() );
+                               array_push( $pages, 
$page->getTitle()->getDBkey() );
                        }
                }
 
@@ -622,7 +622,7 @@
                }
 
                if ( isset( $ourStatus ) ) {
-                       $ourStatus->value = self::AS_HOOK_ERROR;
+                       $ourStatus->value = EditPage::AS_HOOK_ERROR;
                        $status->merge( $ourStatus );
                        return false;
                }
@@ -694,7 +694,7 @@
 
                $dir = __DIR__ . '/sql/';
 
-               $updater->addExtensionTable( 'pr_index', $dir . 
'ProofreadIndex.sql', true );
+               $updater->addExtensionTable( 'pr_index', $dir . 
'ProofreadIndex.sql' );
 
                // fix issue with content type hardcoded in database
                if ( isset( $wgContentHandlerUseDB ) && $wgContentHandlerUseDB 
) {
@@ -795,7 +795,7 @@
 
                        $links['namespaces']['proofreadPageIndexLink'] = [
                                'class' => ( $skin->skinname === 'vector' ) ? 
'icon' : '',
-                               'href' => $indexPage->getTitle()->getLinkUrl(),
+                               'href' => $indexPage->getTitle()->getLinkURL(),
                                'text' => wfMessage( 'proofreadpage_index' 
)->plain()
                        ];
                }
@@ -827,12 +827,7 @@
 
                $api = new ApiMain( $params );
                $api->execute();
-               if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                       $data = $api->getResult()->getResultData();
-               } else {
-                       $data = $api->getResultData();
-               }
-               unset( $api );
+               $data = $api->getResult()->getResultData();
 
                if ( array_key_exists( 'error', $data ) ) {
                        return true;
@@ -851,9 +846,9 @@
 
        protected static function getLinkUrlForTitle( Title $title ) {
                if ( $title->exists() ) {
-                       return $title->getLinkUrl();
+                       return $title->getLinkURL();
                } else {
-                       return $title->getLinkUrl( 'action=edit&redlink=1' );
+                       return $title->getLinkURL( 'action=edit&redlink=1' );
                }
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a5ce1cb63f4e9aa47e3595f24d9b9c8e42c10f3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: 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