r41193 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41192‎ | r41193 | r41194 >
Date:14:30, 23 September 2008
Author:yaron
Status:old
Tags:
Comment:
Fixed format when returning property-value matches for remote autocompletion
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php
@@ -9,7 +9,7 @@
1010
1111 if ( !defined( 'MEDIAWIKI' ) ) die();
1212
13 -define('SF_VERSION','1.3.1');
 13+define('SF_VERSION','1.3.2');
1414
1515 $wgExtensionCredits['specialpage'][]= array(
1616 'name' => 'Semantic Forms',
@@ -630,7 +630,11 @@
631631 $string_value = str_replace('_', ' ', $dv->getXSDValue());
632632 $string_value = str_replace("'", "\'", $string_value);
633633 if (array_search($string_value, $pages) === false)
634 - $pages[] = $string_value;
 634+ if ($substring != null)
 635+ $pages[] = array('title' => str_replace('_', ' '
 636+, $string_value));
 637+ else
 638+ $pages[] = $string_value;
635639 }
636640 // if there was a substring specified, also find values that have
637641 // it after a space, not just at the beginning of the value
@@ -640,7 +644,7 @@
641645 $requestoptions2->addStringCondition(" $substring", SMWStringCondition::STRCOND_MID);
642646 $data_values = $store->getPropertyValues(null, $property, $requestoptions2);
643647 foreach ($data_values as $dv) {
644 - $pages[] = $dv->getXSDValue();
 648+ $pages[] = array('title' => str_replace('_', ' ', $dv->getXSDValue()));
645649 }
646650 }
647651 return $pages;

Status & tagging log