Merge "Show a warning in edit preview when a template loop is detected"
[lhc/web/wiklou.git] / includes / api / ApiQueryBase.php
index f8eaa84..6987dfb 100644 (file)
@@ -97,9 +97,7 @@ abstract class ApiQueryBase extends ApiBase {
                return $this->mQueryModule;
        }
 
-       /**
-        * @see ApiBase::getParent()
-        */
+       /** @inheritDoc */
        public function getParent() {
                return $this->getQuery();
        }
@@ -121,7 +119,7 @@ abstract class ApiQueryBase extends ApiBase {
         * See ApiQuery::getNamedDB() for more information
         * @param string $name Name to assign to the database connection
         * @param int $db One of the DB_* constants
-        * @param array $groups Query groups
+        * @param string|string[] $groups Query groups
         * @return IDatabase
         */
        public function selectNamedDB( $name, $db, $groups ) {
@@ -456,10 +454,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
@@ -478,7 +479,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
         */