Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryPrinters.php |
— | — | @@ -480,19 +480,21 @@ |
481 | 481 | $curcolor = ($curcolor + 1) % 10; |
482 | 482 | } |
483 | 483 | } |
484 | | - ksort($positions); |
485 | | - $positions = array_values($positions); |
486 | | - switch ($this->m_tlpos) { |
487 | | - case 'start': |
488 | | - $result .= '<span class="smwtlposition">' . $positions[0] . '</span>'; |
489 | | - break; |
490 | | - case 'end': |
491 | | - $result .= '<span class="smwtlposition">' . $positions[count($positions)-1] . '</span>'; |
492 | | - break; |
493 | | - case 'today': break; // default |
494 | | - case 'middle': default: |
495 | | - $result .= '<span class="smwtlposition">' . $positions[ceil(count($positions)/2)-1] . '</span>'; |
496 | | - break; |
| 484 | + if (count($positions) > 0) { |
| 485 | + ksort($positions); |
| 486 | + $positions = array_values($positions); |
| 487 | + switch ($this->m_tlpos) { |
| 488 | + case 'start': |
| 489 | + $result .= '<span class="smwtlposition">' . $positions[0] . '</span>'; |
| 490 | + break; |
| 491 | + case 'end': |
| 492 | + $result .= '<span class="smwtlposition">' . $positions[count($positions)-1] . '</span>'; |
| 493 | + break; |
| 494 | + case 'today': break; // default |
| 495 | + case 'middle': default: |
| 496 | + $result .= '<span class="smwtlposition">' . $positions[ceil(count($positions)/2)-1] . '</span>'; |
| 497 | + break; |
| 498 | + } |
497 | 499 | } |
498 | 500 | } |
499 | 501 | //no further results displayed ... |