MathiasLidal has uploaded a new change for review.
https://gerrit.wikimedia.org/r/71324
Change subject: Set correct default-value for offset
......................................................................
Set correct default-value for offset
If a KML query does not have explicit offset, the system will choose
a value after the current result set (the code used is actually for
generating the "additional results..." linki). Fix by giving offset
a default value of 0
Fixes bug 47355
Change-Id: I9798a255ec85c24f8535de0e0546371a5c59aa82
---
M includes/queryprinters/SM_KMLPrinter.php
1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMaps
refs/changes/24/71324/1
diff --git a/includes/queryprinters/SM_KMLPrinter.php
b/includes/queryprinters/SM_KMLPrinter.php
index b9ba95d..5c391a1 100644
--- a/includes/queryprinters/SM_KMLPrinter.php
+++ b/includes/queryprinters/SM_KMLPrinter.php
@@ -131,6 +131,15 @@
$link->setParameter( $this->params['text'], 'text' );
}
+ // Fix for offset-error in getQueryLink()
+ // (getQueryLink by default sets offset to point to the next
+ // result set, fix by setting it to 0 if now explicitly set)
+ if ( array_key_exists( 'offset', $this->params ) ) {
+ $link->setParameter( $this->params['offset'], 'offset'
);
+ } else {
+ $link->setParameter( $this->params['offset'], 0 );
+ }
+
if ( array_key_exists( 'limit', $this->params ) ) {
$link->setParameter( $this->params['limit'], 'limit' );
} else { // Use a reasonable default limit.
--
To view, visit https://gerrit.wikimedia.org/r/71324
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9798a255ec85c24f8535de0e0546371a5c59aa82
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticMaps
Gerrit-Branch: master
Gerrit-Owner: MathiasLidal <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits