From: Roan Kattouw Date: Thu, 21 Jul 2011 18:03:25 +0000 (+0000) Subject: Fix r78824 after some misunderstandings in the CR comments. The querypage API module... X-Git-Tag: 1.31.0-rc.0~28698 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=06d3c6ef2bf3d01545e7fc036398d7770096e0dd;p=lhc%2Fweb%2Fwiklou.git 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. --- 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;