r97742 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97741‎ | r97742 | r97743 >
Date:15:58, 21 September 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
default format fix
Modified paths:
  • /trunk/extensions/SemanticMaps/includes/SM_GeoCoordsHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/includes/SM_GeoCoordsHooks.php
@@ -33,7 +33,8 @@
3434 // Only apply when there is more then one print request.
3535 // This way requests comming from #show are ignored.
3636 if ( count( $printRequests ) > 0 ) {
37 - $allCoords = true;
 37+ $allValid = true;
 38+ $hasCoords = false;
3839
3940 // Loop through the print requests to determine their types.
4041 foreach( $printRequests as /* SMWPrintRequest */ $printRequest ) {
@@ -43,15 +44,18 @@
4445 }
4546
4647 $typeId = $printRequest->getTypeID();
47 -
48 - if ( $typeId != '_geo' ) {
49 - $allCoords = false;
 48+
 49+ if ( $typeId == '_geo' ) {
 50+ $hasCoords = true;
 51+ }
 52+ else {
 53+ $allValid = false;
5054 break;
5155 }
5256 }
5357
5458 // If they are all coordinates, set the result format to 'map'.
55 - if ( $allCoords ) {
 59+ if ( $allValid && $hasCoords ) {
5660 $format = 'map';
5761 }
5862 }