X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryPageProps.php;h=e51c7ab07eefee379ab2df20a5f931bca1de332f;hb=a316b0788f91deaf32b3cc7a496188b3cbb85462;hp=9dd2c6a8007d45830d71a01b54791dcd936364fd;hpb=7bb29a97ae51ce8c74599871f8e688e72aac2811;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryPageProps.php b/includes/api/ApiQueryPageProps.php index 9dd2c6a800..e51c7ab07e 100644 --- a/includes/api/ApiQueryPageProps.php +++ b/includes/api/ApiQueryPageProps.php @@ -60,7 +60,10 @@ class ApiQueryPageProps extends ApiQueryBase { } # Force a sort order to ensure that properties are grouped by page - $this->addOption( 'ORDER BY', 'pp_page' ); + # But only if pp_page is not constant in the WHERE clause. + if ( count( $pages ) > 1 ) { + $this->addOption( 'ORDER BY', 'pp_page' ); + } $res = $this->select( __METHOD__ ); $currentPage = 0; # Id of the page currently processed @@ -112,6 +115,7 @@ class ApiQueryPageProps extends ApiQueryBase { if ( !$fit ) { $this->setContinueEnumParameter( 'continue', $page ); } + return $fit; } @@ -122,14 +126,17 @@ class ApiQueryPageProps extends ApiQueryBase { public function getAllowedParams() { return array( 'continue' => null, - 'prop' => null, + 'prop' => array( + ApiBase::PARAM_ISMULTI => true, + ), ); } public function getParamDescription() { return array( 'continue' => 'When more results are available, use this to continue', - 'prop' => 'Page prop to look on the page for. Useful for checking whether a certain page uses a certain page prop.' + 'prop' => 'Only list these props. Useful for checking whether a ' . + 'certain page uses a certain page prop', ); }