r101269 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101268‎ | r101269 | r101270 >
Date:15:08, 29 October 2011
Author:mkroetzsch
Status:deferred
Tags:
Comment:
properly convert ' ' to '_' in subobject names (just like in #fragments)
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Subobject.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Subobject.php
@@ -27,7 +27,7 @@
2828
2929 $params = func_get_args();
3030 array_shift( $params ); // We already know the $parser ...
31 - $subobjectName = trim( array_shift( $params ) );
 31+ $subobjectName = str_replace( ' ', '_', trim( array_shift( $params ) ) );
3232
3333 $semanticData = SMWParseData::getSMWData( $parser )->getChild( $subobjectName );
3434
@@ -37,6 +37,8 @@
3838 // Only add the property when there is both a name and a value.
3939 if ( count( $parts ) == 2 ) {
4040 self::addPropertyValueToSemanticData( $parts[0], $parts[1], $semanticData );
 41+ } else {
 42+ //self::$m_errors[] = wfMsgForContent( 'smw_noinvannot' );
4143 }
4244 }
4345