Merge "Don't fallback from uk to ru"
[lhc/web/wiklou.git] / includes / api / ApiQuery.php
index 5e3c709..16bd725 100644 (file)
@@ -168,7 +168,7 @@ class ApiQuery extends ApiBase {
         * @param string $name Name to assign to the database connection
         * @param int $db One of the DB_* constants
         * @param array $groups Query groups
-        * @return DatabaseBase
+        * @return Database
         */
        public function getNamedDB( $name, $db, $groups ) {
                if ( !array_key_exists( $name, $this->mNamedDB ) ) {
@@ -258,6 +258,11 @@ class ApiQuery extends ApiBase {
                // Write the continuation data into the result
                $this->setContinuationManager( null );
                if ( $this->mParams['rawcontinue'] ) {
+                       $data = $continuationManager->getRawNonContinuation();
+                       if ( $data ) {
+                               $this->getResult()->addValue( null, 'query-noncontinue', $data,
+                                       ApiResult::ADD_ON_TOP | ApiResult::NO_SIZE_CHECK );
+                       }
                        $data = $continuationManager->getRawContinuation();
                        if ( $data ) {
                                $this->getResult()->addValue( null, 'query-continue', $data,
@@ -357,6 +362,9 @@ class ApiQuery extends ApiBase {
                        $vals = [];
                        ApiQueryBase::addTitleInfo( $vals, $title );
                        $vals['missing'] = true;
+                       if ( $title->isKnown() ) {
+                               $vals['known'] = true;
+                       }
                        $pages[$fakeId] = $vals;
                }
                // Report any invalid titles
@@ -367,7 +375,7 @@ class ApiQuery extends ApiBase {
                foreach ( $pageSet->getMissingPageIDs() as $pageid ) {
                        $pages[$pageid] = [
                                'pageid' => $pageid,
-                               'missing' => true
+                               'missing' => true,
                        ];
                }
                // Report special pages
@@ -376,13 +384,7 @@ class ApiQuery extends ApiBase {
                        $vals = [];
                        ApiQueryBase::addTitleInfo( $vals, $title );
                        $vals['special'] = true;
-                       if ( $title->isSpecialPage() &&
-                               !SpecialPageFactory::exists( $title->getDBkey() )
-                       ) {
-                               $vals['missing'] = true;
-                       } elseif ( $title->getNamespace() == NS_MEDIA &&
-                               !wfFindFile( $title )
-                       ) {
+                       if ( !$title->isKnown() ) {
                                $vals['missing'] = true;
                        }
                        $pages[$fakeId] = $vals;