Make API documentation links language aware
[lhc/web/wiklou.git] / includes / api / ApiQueryAllLinks.php
index ac90605..9d6bf46 100644 (file)
@@ -116,9 +116,13 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
                        $matches = array_intersect_key( $prop, $this->props + [ 'ids' => 1 ] );
                        if ( $matches ) {
                                $p = $this->getModulePrefix();
-                               $this->dieUsage(
-                                       "Cannot use {$p}prop=" . implode( '|', array_keys( $matches ) ) . " with {$p}unique",
-                                       'params'
+                               $this->dieWithError(
+                                       [
+                                               'apierror-invalidparammix-cannotusewith',
+                                               "{$p}prop=" . implode( '|', array_keys( $matches ) ),
+                                               "{$p}unique"
+                                       ],
+                                       'invalidparammix'
                                );
                        }
                        $this->addOption( 'DISTINCT' );
@@ -259,7 +263,8 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
                        ],
                        'namespace' => [
                                ApiBase::PARAM_DFLT => $this->dfltNamespace,
-                               ApiBase::PARAM_TYPE => 'namespace'
+                               ApiBase::PARAM_TYPE => 'namespace',
+                               ApiBase::PARAM_EXTRA_NAMESPACES => [ NS_MEDIA, NS_SPECIAL ],
                        ],
                        'limit' => [
                                ApiBase::PARAM_DFLT => 10,
@@ -303,6 +308,6 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
        public function getHelpUrls() {
                $name = ucfirst( $this->getModuleName() );
 
-               return "https://www.mediawiki.org/wiki/API:{$name}";
+               return "https://www.mediawiki.org/wiki/Special:MyLanguage/API:{$name}";
        }
 }