r86616 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86615‎ | r86616 | r86617 >
Date:10:26, 21 April 2011
Author:mkroetzsch
Status:deferred
Tags:
Comment:
fixes for properly using new data items
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Description.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Description.php
@@ -296,7 +296,8 @@
297297 }
298298
299299 public function getQueryString( $asvalue = false ) {
300 - $result = '[[' . $this->m_concept->getConceptQuery() . ']]';
 300+ $pageValue = SMWDataValueFactory::newDataItemValue( $this->m_concept );
 301+ $result = '[[' . $pageValue->getPrefixedText() . ']]';
301302 if ( $asvalue ) {
302303 return ' <q>' . $result . '</q> ';
303304 } else {
@@ -755,21 +756,21 @@
756757
757758 public function getQueryString( $asvalue = false ) {
758759 $subdesc = $this->m_description;
759 - $propertychain = $this->m_property->getWikiValue();
760 - $propertyname = 'loop ...';
761 -
 760+ $propertyChainString = $this->m_property->getLabel();
 761+ $propertyname = $propertyChainString;
 762+
762763 while ( ( $propertyname != '' ) && ( $subdesc instanceof SMWSomeProperty ) ) { // try to use property chain syntax
763 - $propertyname = $subdesc->getProperty()->getWikiValue();
 764+ $propertyname = $subdesc->getProperty()->getLabel();
764765 if ( $propertyname != '' ) {
765 - $propertychain .= '.' . $propertyname;
 766+ $propertyChainString .= '.' . $propertyname;
766767 $subdesc = $subdesc->getDescription();
767768 }
768769 }
769 -
 770+
770771 if ( $asvalue ) {
771 - return '<q>[[' . $propertychain . '::' . $subdesc->getQueryString( true ) . ']]</q>';
 772+ return '<q>[[' . $propertyChainString . '::' . $subdesc->getQueryString( true ) . ']]</q>';
772773 } else {
773 - return '[[' . $propertychain . '::' . $subdesc->getQueryString( true ) . ']]';
 774+ return '[[' . $propertyChainString . '::' . $subdesc->getQueryString( true ) . ']]';
774775 }
775776 }
776777

Status & tagging log