dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make API documentation links language aware
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiQueryAllLinks.php
diff --git
a/includes/api/ApiQueryAllLinks.php
b/includes/api/ApiQueryAllLinks.php
index
94707da
..
9d6bf46
100644
(file)
--- a/
includes/api/ApiQueryAllLinks.php
+++ b/
includes/api/ApiQueryAllLinks.php
@@
-116,9
+116,13
@@
class ApiQueryAllLinks extends ApiQueryGeneratorBase {
$matches = array_intersect_key( $prop, $this->props + [ 'ids' => 1 ] );
if ( $matches ) {
$p = $this->getModulePrefix();
$matches = array_intersect_key( $prop, $this->props + [ 'ids' => 1 ] );
if ( $matches ) {
$p = $this->getModulePrefix();
- $this->dieUsage(
- "Cannot use {$p}prop=" . join( '|', array_keys( $matches ) ) . " with {$p}unique",
- 'params'
+ $this->dieWithError(
+ [
+ 'apierror-invalidparammix-cannotusewith',
+ "{$p}prop=" . implode( '|', array_keys( $matches ) ),
+ "{$p}unique"
+ ],
+ 'invalidparammix'
);
}
$this->addOption( 'DISTINCT' );
);
}
$this->addOption( 'DISTINCT' );
@@
-259,7
+263,8
@@
class ApiQueryAllLinks extends ApiQueryGeneratorBase {
],
'namespace' => [
ApiBase::PARAM_DFLT => $this->dfltNamespace,
],
'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,
],
'limit' => [
ApiBase::PARAM_DFLT => 10,
@@
-303,6
+308,6
@@
class ApiQueryAllLinks extends ApiQueryGeneratorBase {
public function getHelpUrls() {
$name = ucfirst( $this->getModuleName() );
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}";
}
}
}
}