r88195 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88194‎ | r88195 | r88196 >
Date:16:59, 15 May 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
correctly determine if a DV is a page or not
Modified paths:
  • /trunk/extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php
@@ -127,16 +127,17 @@
128128 for ( $i = 0, $n = count( $row ); $i < $n; $i++ ) { // Properties
129129 while ( ( $obj = efSRFGetNextDV( $row[$i] ) ) !== false ) { // Property values
130130
 131+ $isSubject = $row[$i]->getPrintRequest()->getMode() == SMWPrintRequest::PRINT_THIS;
 132+
131133 // If the main object should not be included, skip it.
132 - // The isMainObject method was added in SMW 1.5.6, so this can only be done correctly if it's available.
133 - if ( $i == 0 && !$this->includeName && method_exists( $obj, 'isMainObject' ) && $obj->isMainObject() ) {
 134+ if ( $i == 0 && !$this->includeName && $isSubject ) {
134135 continue;
135136 }
136137
137138 // Get the HTML for the tag content. Pages are linked, other stuff is just plaintext.
138139 if ( $obj->getTypeID() == '_wpg' ) {
139140 $value = $obj->getTitle()->getText();
140 - $html = $obj->getLongText( $outputmode, $this->getLinker( method_exists( $obj, 'isMainObject' ) && $obj->isMainObject() ) );
 141+ $html = $obj->getLongText( $outputmode, $isSubject );
141142 }
142143 else {
143144 $html = $obj->getShortText( $outputmode, $this->getLinker( false ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r88570follow up to r88195jeroendedauw11:38, 22 May 2011

Status & tagging log