Jeroen De Dauw has submitted this change and it was merged.
Change subject: Fix ApiSandbox continue param default
......................................................................
Fix ApiSandbox continue param default
This is how the continue param is defined for things
in core. This stops the ApiSandbox extension from
giving continue a default of 10.
Bug: 62959
Change-Id: I8eca2a90a9628ee835156fb767fda11019d42af8
---
M repo/includes/api/SearchEntities.php
1 file changed, 2 insertions(+), 11 deletions(-)
Approvals:
WikidataJenkins: Verified
Jeroen De Dauw: Looks good to me, approved
diff --git a/repo/includes/api/SearchEntities.php
b/repo/includes/api/SearchEntities.php
index ee7e7bf..a687003 100644
--- a/repo/includes/api/SearchEntities.php
+++ b/repo/includes/api/SearchEntities.php
@@ -290,13 +290,11 @@
// Actual result set.
$entries = array_slice( $entries, $params['continue'],
$params['limit'] );
- $allowedParams = $this->getAllowedParams();
$nextContinuation = $params['continue'] + $params['limit'];
- $maxContinuation =
$allowedParams['continue'][ApiBase::PARAM_MAX];
// Only pass search-continue param if there are more results
and the maximum continuation
// limit is not exceeded.
- if ( $hits > $nextContinuation && $nextContinuation <=
$maxContinuation ) {
+ if ( $hits > $nextContinuation && $nextContinuation <=
ApiBase::LIMIT_SML1 ) {
$this->getResult()->addValue(
null,
'search-continue',
@@ -347,14 +345,7 @@
ApiBase::PARAM_MIN => 0,
ApiBase::PARAM_RANGE_ENFORCE => true,
),
- 'continue' => array(
- ApiBase::PARAM_TYPE => 'limit',
- ApiBase::PARAM_DFLT => 0,
- ApiBase::PARAM_MAX => ApiBase::LIMIT_SML1,
- ApiBase::PARAM_MAX2 => ApiBase::LIMIT_SML2,
- ApiBase::PARAM_MIN => 0,
- ApiBase::PARAM_RANGE_ENFORCE => true,
- ),
+ 'continue' => null,
);
}
--
To view, visit https://gerrit.wikimedia.org/r/120219
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8eca2a90a9628ee835156fb767fda11019d42af8
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: WikidataJenkins <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits