From 06d3c6ef2bf3d01545e7fc036398d7770096e0dd Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 21 Jul 2011 18:03:25 +0000 Subject: [PATCH] Fix r78824 after some misunderstandings in the CR comments. The querypage API module was checking for disabled status and setting the 'disabled' attribute in the output, but would then happily proceed to call doQuery() on a disabled query page. --- includes/api/ApiQueryQueryPage.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/api/ApiQueryQueryPage.php b/includes/api/ApiQueryQueryPage.php index c881a8ccfd..e259feab79 100644 --- a/includes/api/ApiQueryQueryPage.php +++ b/includes/api/ApiQueryQueryPage.php @@ -97,6 +97,11 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase { } } $result->addValue( array( 'query' ), $this->getModuleName(), $r ); + + if ( $qp->isCached() && !$qp->isCacheable() ) { + // Disabled query page, don't run the query + return; + } $res = $qp->doQuery( $params['limit'] + 1, $params['offset'] ); $count = 0; -- 2.20.1