http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97742
Revision: 97742
Author: jeroendedauw
Date: 2011-09-21 15:58:50 +0000 (Wed, 21 Sep 2011)
Log Message:
-----------
default format fix
Modified Paths:
--------------
trunk/extensions/SemanticMaps/includes/SM_GeoCoordsHooks.php
Modified: trunk/extensions/SemanticMaps/includes/SM_GeoCoordsHooks.php
===================================================================
--- trunk/extensions/SemanticMaps/includes/SM_GeoCoordsHooks.php
2011-09-21 15:33:27 UTC (rev 97741)
+++ trunk/extensions/SemanticMaps/includes/SM_GeoCoordsHooks.php
2011-09-21 15:58:50 UTC (rev 97742)
@@ -33,7 +33,8 @@
// Only apply when there is more then one print request.
// This way requests comming from #show are ignored.
if ( count( $printRequests ) > 0 ) {
- $allCoords = true;
+ $allValid = true;
+ $hasCoords = false;
// Loop through the print requests to determine
their types.
foreach( $printRequests as /* SMWPrintRequest
*/ $printRequest ) {
@@ -43,15 +44,18 @@
}
$typeId = $printRequest->getTypeID();
-
- if ( $typeId != '_geo' ) {
- $allCoords = false;
+
+ if ( $typeId == '_geo' ) {
+ $hasCoords = true;
+ }
+ else {
+ $allValid = false;
break;
}
}
// If they are all coordinates, set the result
format to 'map'.
- if ( $allCoords ) {
+ if ( $allValid && $hasCoords ) {
$format = 'map';
}
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs