r71899 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71898‎ | r71899 | r71900 >
Date:20:32, 29 August 2010
Author:mkroetzsch
Status:ok
Tags:
Comment:
Fixing Bug 23781 (assuming that it was caused by namespace-like prefixes in property names confusing the Title generation)
-This line, and those below, will be ignored--

M includes/SMW_QueryProcessor.php
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php
@@ -205,16 +205,16 @@
206206 continue;
207207 }
208208
209 - if ( $title->getNamespace() == SMW_NS_PROPERTY ) {
 209+ if ( $title->getNamespace() == NS_CATEGORY ) {
 210+ $printmode = SMWPrintRequest::PRINT_CCAT;
 211+ $data = $title;
 212+ $label = $showmode ? '' : $title->getText(); // default
 213+ } else { // enforce interpretation as property (even if it starts with something that looks like another namespace)
210214 $printmode = SMWPrintRequest::PRINT_PROP;
211215 $property = SMWPropertyValue::makeUserProperty( trim( $propparts[0] ) );
212216 $data = $property;
213217 $label = $showmode ? '' : $property->getWikiValue(); // default
214 - } elseif ( $title->getNamespace() == NS_CATEGORY ) {
215 - $printmode = SMWPrintRequest::PRINT_CCAT;
216 - $data = $title;
217 - $label = $showmode ? '' : $title->getText(); // default
218 - } // else?
 218+ }
219219 }
220220
221221 if ( count( $propparts ) == 1 ) { // no outputformat found, leave empty

Status & tagging log