Anomie has uploaded a new change for review.

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

Change subject: Remove pre-1.25 API compatibility code
......................................................................

Remove pre-1.25 API compatibility code

Since this extension uses extension.json, it already requires 1.25+ so
no need to keep the old code around.

Change-Id: Ib2e0496eee1ae603fc9be820e526b50a4e900279
---
M api/ApiFeedLQTThreads.php
M api/ApiQueryLQTThreads.php
M api/ApiThreadAction.php
M classes/Hooks.php
4 files changed, 9 insertions(+), 167 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/87/311787/1

diff --git a/api/ApiFeedLQTThreads.php b/api/ApiFeedLQTThreads.php
index 4d10399..7c4dce7 100644
--- a/api/ApiFeedLQTThreads.php
+++ b/api/ApiFeedLQTThreads.php
@@ -243,37 +243,6 @@
        }
 
        /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getParamDescription() {
-               return array (
-                       'feedformat' => 'The format of the feed',
-                       'days'      => 'Number of days of threads to show',
-                       'type'      => 'Types of posts to show',
-                       'talkpage' => 'Limit results to threads on these talk 
pages',
-                       'thread' => 'Limit results to these threads and their 
descendants',
-               );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getDescription() {
-               return 'This module returns a feed of discussion threads';
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getExamples() {
-               return array (
-                       'api.php?action=feedthreads',
-                       
'api.php?action=feedthreads&type=replies&thread=Thread:Foo',
-                       
'api.php?action=feedthreads&type=newthreads&talkpage=Talk:Main_Page',
-               );
-       }
-
-       /**
         * @see ApiBase::getExamplesMessages()
         */
        protected function getExamplesMessages() {
diff --git a/api/ApiQueryLQTThreads.php b/api/ApiQueryLQTThreads.php
index b6b79b5..458e75e 100644
--- a/api/ApiQueryLQTThreads.php
+++ b/api/ApiQueryLQTThreads.php
@@ -165,11 +165,7 @@
                        );
                }
 
-               if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                       $result->addIndexedTagName( array( 'query', 
$this->getModuleName() ), 'thread' );
-               } else {
-                       $result->setIndexedTagName_internal( array( 'query', 
$this->getModuleName() ), 'thread' );
-               }
+               $result->addIndexedTagName( array( 'query', 
$this->getModuleName() ), 'thread' );
        }
 
        protected function addSubItems( $tableName, $fields, $joinField, 
$subitemName, /*callable*/ $handleRow, $tagName ) {
@@ -202,11 +198,7 @@
                                $output
                        );
 
-                       if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                               $result->addIndexedTagName( array_merge( $path, 
array( $subitemName ) ), $tagName );
-                       } else {
-                               $result->setIndexedTagName_internal( 
array_merge( $path, array( $subitemName ) ), $tagName );
-                       }
+                       $result->addIndexedTagName( array_merge( $path, array( 
$subitemName ) ), $tagName );
                }
        }
 
@@ -357,8 +349,7 @@
                                        'older'
                                ),
                                ApiBase :: PARAM_DFLT => 'newer',
-                               /** @todo Once support for MediaWiki < 1.25 is 
dropped, just use ApiBase::PARAM_HELP_MSG directly */
-                               constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' => 
'api-help-param-direction',
+                               ApiBase::PARAM_HELP_MSG => 
'api-help-param-direction',
                        ),
                        'showdeleted' => false,
                        'limit' => array(
@@ -408,53 +399,6 @@
                        'renderstartrepliesat' => array(
                                ApiBase :: PARAM_DFLT => null,
                        ),
-               );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getParamDescription() {
-               return array (
-                       'startid' => 'The thread id to start enumerating from',
-                       'endid' => 'The thread id to stop enumerating at',
-                       'dir' => 'The direction in which to enumerate',
-                       'limit' => 'The maximum number of threads to list',
-                       'prop' => 'Which properties to get',
-                       'page' => 'Limit results to threads on a particular 
page(s)',
-                       'author' => 'Limit results to threads by a particular 
author(s)',
-                       'root' => 'Limit results to threads with the given 
root(s)',
-                       'summary' => 'Limit results to threads corresponding to 
the given summary page(s)',
-                       'id' => 'Get threads with the given ID(s)',
-                       'showdeleted' => 'Whether or not to show deleted 
threads',
-                       'render' => 'Whether or not to include the rendered 
thread in the results',
-                       'renderlevel' => 'When rendering, the level at which to 
start (for the sake of depth limits, etc)',
-                       'renderthreadpos' => 'When rendering, the position of 
the thread in the group of ' .
-                                       'threads being rendered at that level 
(affects display somewhat)',
-                       'renderthreadcount' => 'When rendering, the number of 
threads in that level group',
-                       'rendermaxthreadcount' => 'When rendering, the maximum 
number of replies to show ' .
-                                       'before adding a "Show more replies" 
link',
-                       'rendermaxdepth' => 'When rendering, the maximum depth 
of replies to show before ' .
-                                       'showing a "Show X replies" link 
instead of replies',
-                       'renderstartrepliesat' => 'When rendering, the point at 
which to start showing replies ' .
-                                       '(used internally to load extra 
replies)',
-               );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getDescription() {
-               return 'Show details of LiquidThreads threads.';
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getExamples() {
-               return array(
-                       
'api.php?action=query&list=threads&thpage=Talk:Main_Page',
-                       
'api.php?action=query&list=threads&thid=1|2|3|4&thprop=id|subject|modified'
                );
        }
 
diff --git a/api/ApiThreadAction.php b/api/ApiThreadAction.php
index d20a17a..d11f8e5 100644
--- a/api/ApiThreadAction.php
+++ b/api/ApiThreadAction.php
@@ -316,11 +316,7 @@
                $internalApi = new ApiMain( $editReq, true );
                $internalApi->execute();
 
-               if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                       $editResult = 
$internalApi->getResult()->getResultData();
-               } else {
-                       $editResult = $internalApi->getResultData();
-               }
+               $editResult = $internalApi->getResult()->getResultData();
 
                if ( $editResult['edit']['result'] != 'Success' ) {
                        $result = array( 'result' => 'EditFailure', 'details' 
=> $editResult );
@@ -437,11 +433,7 @@
                $internalApi = new ApiMain( $editReq, true );
                $internalApi->execute();
 
-               if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                       $editResult = 
$internalApi->getResult()->getResultData();
-               } else {
-                       $editResult = $internalApi->getResultData();
-               }
+               $editResult = $internalApi->getResult()->getResultData();
 
                if ( $editResult['edit']['result'] != 'Success' ) {
                        $result = array( 'result' => 'EditFailure', 'details' 
=> $editResult );
@@ -555,11 +547,7 @@
                $internalApi = new ApiMain( $editReq, true );
                $internalApi->execute();
 
-               if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                       $editResult = 
$internalApi->getResult()->getResultData();
-               } else {
-                       $editResult = $internalApi->getResultData();
-               }
+               $editResult = $internalApi->getResult()->getResultData();
 
                if ( $editResult['edit']['result'] != 'Success' ) {
                        $result = array( 'result' => 'EditFailure', 'details' 
=> $editResult );
@@ -844,13 +832,6 @@
                $this->getResult()->addValue( null, 'threadaction', $result );
        }
 
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getDescription() {
-               return 'Allows actions to be taken on threads and posts in 
threaded discussions.';
-       }
-
        public function getActions() {
                return array(
                        'markread' => 'actionMarkRead',
@@ -869,46 +850,6 @@
        }
 
        /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getParamDescription() {
-               return array(
-                       'thread' => 'A list (pipe-separated) of thread IDs or 
titles to act on',
-                       'threadaction' => 'The action to take',
-                       'token' => 'An edit token (from 
?action=query&prop=info&intoken=edit)',
-                       'talkpage' => 'The talkpage to act on (if applicable)',
-                       'subject' => 'The subject to set for the new or split 
thread',
-                       'reason' => 'If applicable, the reason/summary for the 
action',
-                       'newparent' => 'If merging a thread, the ID or title 
for its new parent',
-                       'text' => 'The text of the post to create',
-                       'render' => 'If set, on post/reply methods, the 
top-level thread ' .
-                               'after the change will be rendered and returned 
in the result.',
-                       'bump' => 'If set, overrides default behaviour as to 
whether or not to ',
-                               "increase the thread's sort key. If true, sets 
it to current " .
-                               "timestamp. If false, does not set it. Default 
depends on " .
-                               "the action being taken. Presently only works 
for newthread " .
-                               "and reply actions.",
-                       'sortkey' => "Specifies the timestamp to which to set a 
thread's " .
-                                       "sort key. Must be in the form 
YYYYMMddhhmmss, " .
-                                       "a unix timestamp or 'now'.",
-                       'signature' => 'Specifies the signature to use for that 
post. Can be ' .
-                                       'NULL to specify the default signature',
-                       'type' => 'Specifies the type of reaction to add',
-                       'value' => 'Specifies the value associated with the 
reaction to add',
-                       'method' => 'For getting inline edit forms, the method 
to get a form for',
-                       'operand' => '',
-               );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getExamples() {
-               return array(
-               );
-       }
-
-       /**
         * @see ApiBase::getExamplesMessages()
         */
        protected function getExamplesMessages() {
@@ -918,10 +859,6 @@
 
        public function needsToken() {
                return 'csrf';
-       }
-
-       public function getTokenSalt() {
-               return '';
        }
 
        public function getAllowedParams() {
diff --git a/classes/Hooks.php b/classes/Hooks.php
index 6a68269..d1cd2ff 100644
--- a/classes/Hooks.php
+++ b/classes/Hooks.php
@@ -932,17 +932,9 @@
                if ( $module instanceof ApiQueryInfo ) {
                        $result = $module->getResult();
 
-                       if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                               $data = (array)$result->getResultData( array( 
'query', 'pages' ), array(
-                                       'Strip' => 'base'
-                               ) );
-                       } else {
-                               $data = $result->getData();
-                               if ( !isset( $data['query']['pages'] ) ) {
-                                       return true;
-                               }
-                               $data = $data['query']['pages'];
-                       }
+                       $data = (array)$result->getResultData( array( 'query', 
'pages' ), array(
+                               'Strip' => 'base'
+                       ) );
                        foreach ( $data as $pageid => $page ) {
                                if ( $page == 'page' ) continue;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2e0496eee1ae603fc9be820e526b50a4e900279
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>

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

Reply via email to