From: Sorawee Porncharoenwase Date: Thu, 6 Feb 2014 06:36:21 +0000 (+0700) Subject: API: Fix a bug to make list=allfileusages functional again X-Git-Tag: 1.31.0-rc.0~16990^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=ffd00d49c4fec162056de1bcbc2910c01c8645eb API: Fix a bug to make list=allfileusages functional again Querying list=allfileusages with affrom, afto, or afunique will always get afinvalidtitle because the code passes the namespace wrongly due to gerrit Iaa5a71ec. This patch fixes the problem. Change-Id: I010dc3a03be74f49902fd446e7dbc306c16b869c --- diff --git a/includes/api/ApiQueryAllLinks.php b/includes/api/ApiQueryAllLinks.php index 13f766e2ab..bccc25fbfb 100644 --- a/includes/api/ApiQueryAllLinks.php +++ b/includes/api/ApiQueryAllLinks.php @@ -149,14 +149,14 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase { // 'continue' always overrides 'from' $from = ( $continue || $params['from'] === null ? null : - $this->titlePartToKey( $params['from'], $params['namespace'] ) ); + $this->titlePartToKey( $params['from'], $namespace ) ); $to = ( $params['to'] === null ? null : - $this->titlePartToKey( $params['to'], $params['namespace'] ) ); + $this->titlePartToKey( $params['to'], $namespace ) ); $this->addWhereRange( $pfx . $fieldTitle, 'newer', $from, $to ); if ( isset( $params['prefix'] ) ) { $this->addWhere( $pfx . $fieldTitle . $db->buildLike( $this->titlePartToKey( - $params['prefix'], $params['namespace'] ), $db->anyString() ) ); + $params['prefix'], $namespace ), $db->anyString() ) ); } $this->addFields( array( 'pl_title' => $pfx . $fieldTitle ) );