Merge "Title: Make getOtherPage() check canHaveTalkPage()"
[lhc/web/wiklou.git] / includes / api / ApiQueryBase.php
index baefbda..fe16134 100644 (file)
@@ -356,7 +356,6 @@ abstract class ApiQueryBase extends ApiBase {
         * @return ResultWrapper
         */
        protected function select( $method, $extraQuery = [], array &$hookData = null ) {
-
                $tables = array_merge(
                        $this->tables,
                        isset( $extraQuery['tables'] ) ? (array)$extraQuery['tables'] : []
@@ -457,10 +456,13 @@ abstract class ApiQueryBase extends ApiBase {
                                'ipb_id',
                                'ipb_by',
                                'ipb_by_text',
-                               'ipb_reason',
                                'ipb_expiry',
                                'ipb_timestamp'
                        ] );
+                       $commentQuery = CommentStore::newKey( 'ipb_reason' )->getJoin();
+                       $this->addTables( $commentQuery['tables'] );
+                       $this->addFields( $commentQuery['fields'] );
+                       $this->addJoinConds( $commentQuery['joins'] );
                }
 
                // Don't show hidden names
@@ -479,7 +481,7 @@ abstract class ApiQueryBase extends ApiBase {
        /**
         * Add information (title and namespace) about a Title object to a
         * result array
-        * @param array $arr Result array à la ApiResult
+        * @param array &$arr Result array à la ApiResult
         * @param Title $title
         * @param string $prefix Module prefix
         */