r26241 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r26240‎ | r26241 | r26242 >
Date:19:40, 29 September 2007
Author:mkroetzsch
Status:old
Tags:
Comment:
Fixed bug with in-wiki display of nary datatypes.
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Types.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Types.php
@@ -63,13 +63,14 @@
6464 $captions = $this->getTypeCaptions();
6565 reset($captions);
6666 foreach ($this->getTypeLabels() as $type) {
67 - $caption = next($captions);
 67+ $caption = current($captions);
6868 if ($first) {
6969 $first = false;
7070 } else {
7171 $result .= ', ';
7272 }
7373 $result .= '[[' . $typenamespace . ':' . $type . '|' . $caption . ']]';
 74+ next($captions);
7475 }
7576 return $result;
7677 }
@@ -93,14 +94,17 @@
9495 }
9596 $result = '';
9697 $first = true;
 98+ reset($captions);
9799 foreach ($this->getTypeLabels() as $type) {
 100+ $caption = current($captions);
98101 if ($first) {
99102 $first = false;
100103 } else {
101104 $result .= ', ';
102105 }
103106 $title = Title::newFromText($type, SMW_NS_TYPE);
104 - $result .= $linker->makeLinkObj( $title, $type);
 107+ $result .= $linker->makeLinkObj( $title, $caption);
 108+ next($captions);
105109 }
106110 return $result;
107111 }

Status & tagging log