API: Correct 'from_namespace' logic in ApiQueryBacklinksprop

The code for the rdnamespace parameter to prop=redirects was trying to
use a nonexistent rd_from_namespace field when miser mode was not
enabled.

Bug: T113453
Change-Id: I7ef77a01c25fec34623b888f439261423cebdaef
This commit is contained in:
Brad Jorsch 2015-09-23 09:31:39 -04:00
parent a09d063de3
commit 462a7baa00

View file

@ -143,8 +143,12 @@ class ApiQueryBacklinksprop extends ApiQueryGeneratorBase {
}
$miser_ns = null;
if ( $params['namespace'] !== null ) {
if ( empty( $settings['from_namespace'] ) && $this->getConfig()->get( 'MiserMode' ) ) {
$miser_ns = $params['namespace'];
if ( empty( $settings['from_namespace'] ) ) {
if ( $this->getConfig()->get( 'MiserMode' ) ) {
$miser_ns = $params['namespace'];
} else {
$this->addWhereFld( 'page_namespace', $params['namespace'] );
}
} else {
$this->addWhereFld( "{$p}_from_namespace", $params['namespace'] );
if ( !empty( $settings['from_namespace'] ) && count( $params['namespace'] ) > 1 ) {