From 462a7baa00d02bea54c643fa4baf042936863f40 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Wed, 23 Sep 2015 09:31:39 -0400 Subject: [PATCH] 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 --- includes/api/ApiQueryBacklinksprop.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiQueryBacklinksprop.php b/includes/api/ApiQueryBacklinksprop.php index a50d58b22f..f1a2271c12 100644 --- a/includes/api/ApiQueryBacklinksprop.php +++ b/includes/api/ApiQueryBacklinksprop.php @@ -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 ) { -- 2.20.1