jenkins-bot has submitted this change and it was merged.
Change subject: Set PARAM_DFLT to 500 for radius
......................................................................
Set PARAM_DFLT to 500 for radius
When running with no radius param 0 seems to be used. Unfortunately
it causes a failure in elastic:
IllegalArgumentException: invalid radiusMeters 0.0
Set PARAM_DFLT to MIN_RADIUS so that the MIN/MAX range is always
respected.
Change-Id: Iec08f60dd0d8fbf196e554d116354846f3c9e1a9
---
M includes/api/ApiQueryGeoSearch.php
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
EBernhardson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/api/ApiQueryGeoSearch.php
b/includes/api/ApiQueryGeoSearch.php
index 7b7269d..e698080 100644
--- a/includes/api/ApiQueryGeoSearch.php
+++ b/includes/api/ApiQueryGeoSearch.php
@@ -10,6 +10,7 @@
abstract class ApiQueryGeoSearch extends ApiQueryGeneratorBase {
const MIN_RADIUS = 10;
+ const DEFAULT_RADIUS = 500;
/**
* @var Coord The center of search area
@@ -141,6 +142,7 @@
],
'radius' => [
ApiBase::PARAM_TYPE => 'integer',
+ ApiBase::PARAM_DFLT => min(
self::DEFAULT_RADIUS, $wgMaxGeoSearchRadius ),
ApiBase::PARAM_MIN => self::MIN_RADIUS,
ApiBase::PARAM_MAX => $wgMaxGeoSearchRadius,
ApiBase::PARAM_RANGE_ENFORCE => true,
--
To view, visit https://gerrit.wikimedia.org/r/313974
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iec08f60dd0d8fbf196e554d116354846f3c9e1a9
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/GeoData
Gerrit-Branch: master
Gerrit-Owner: DCausse <[email protected]>
Gerrit-Reviewer: DCausse <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits