From: Brad Jorsch Date: Wed, 23 Sep 2015 13:31:39 +0000 (-0400) Subject: API: Correct 'from_namespace' logic in ApiQueryBacklinksprop X-Git-Tag: 1.31.0-rc.0~9778^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=462a7baa00d02bea54c643fa4baf042936863f40;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ) {