Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_MapPrinter.php |
— | — | @@ -286,18 +286,18 @@ |
287 | 287 | } |
288 | 288 | |
289 | 289 | // If there is no point specific icon, use the general icon parameter when available. |
290 | | - if ( !array_key_exists( 'icon', $markerData ) && $this->icon != '' ) { |
| 290 | + if ( !array_key_exists( 'icon', $markerData ) ) { |
291 | 291 | $markerData['icon'] = $this->icon; |
292 | 292 | } |
293 | 293 | |
294 | | - // Get the url for the icon when there is one, else set the icon to an empty string. |
295 | | - if ( array_key_exists( 'icon', $markerData ) ) { |
296 | | - $icon_image_page = new ImagePage( Title::newFromText( $markerData['icon'] ) ); |
297 | | - $markerData['icon'] = $icon_image_page->getDisplayedFile()->getURL(); |
| 294 | + if ( $markerData['icon'] != '' ) { |
| 295 | + $title = Title::newFromText( $markerData['icon'] ); |
| 296 | + |
| 297 | + if ( !is_null( $title ) && $title->exists() ) { |
| 298 | + $iconImagePage = new ImagePage( $title ); |
| 299 | + $markerData['icon'] = $iconImagePage->getDisplayedFile()->getURL(); |
| 300 | + } |
298 | 301 | } |
299 | | - else { |
300 | | - $markerData['icon'] = ''; |
301 | | - } |
302 | 302 | |
303 | 303 | // Temporary fix, will refactor away later |
304 | 304 | // TODO |