From 9ecac6579457dddf30a2dcf2422d80a6e687de5b Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 17 Nov 2014 11:18:09 -0500 Subject: [PATCH] API: Always request page_is_redirect from ApiQueryInfo The ApiPageSet doesn't know for sure whether it will be resolving redirects until it is executed, as the revids parameter may override that (and it can't easily check before being executed because it might never actually be executed). So ApiQueryInfo needs to just unconditionally request page_is_redirect and only consider later whether to try using it. Bug: 73464 Change-Id: I2297158188dae5476c5b9b5755ea26cf5b8ae487 --- includes/api/ApiQueryInfo.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 5e61ed1136..263ab0d00e 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -58,10 +58,10 @@ class ApiQueryInfo extends ApiQueryBase { */ public function requestExtraData( $pageSet ) { $pageSet->requestField( 'page_restrictions' ); - // when resolving redirects, no page will have this field - if ( !$pageSet->isResolvingRedirects() ) { - $pageSet->requestField( 'page_is_redirect' ); - } + // If the pageset is resolving redirects we won't get page_is_redirect. + // But we can't know for sure until the pageset is executed (revids may + // turn it off), so request it unconditionally. + $pageSet->requestField( 'page_is_redirect' ); $pageSet->requestField( 'page_is_new' ); $config = $this->getConfig(); $pageSet->requestField( 'page_touched' ); -- 2.20.1