Page MenuHomePhabricator

Semantic MediaWiki PHP Error in RSS Query Printer when using creator or date labels
Closed, ResolvedPublic

Description

I'm using trunk of SMW and trying to create an RSS feed like this:

{{#ask: [[Category:Book Pile]] [[Added by::+]] [[Added on::+]]

? Added by = creator
? Added on = date
sort=Added on
order=DESC
format=rss
rsstitle=Book Pile
rssdescription=Latest suggestions of books to consider reading.

}}

The feed will work if "= creator" and "= date" are not set. If they are set, I get the following PHP error.

PHP Fatal error: Call to undefined method SMWDIWikiPage::getShortWikiText() in /srv/www/mediawiki/public_html/w/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_RSSlink.php on line 75

PHP Fatal error: Call to undefined method SMWDITime::getXMLSchemaDate() in /srv/www/mediawiki/public_html/w/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_RSSlink.php on line 79

The code in question is the method call on $entry here

if ( strtolower( $req->getLabel() ) == 'creator' ) {

		foreach ( $field->getContent() as $entry ) {
				$creators[] = $entry->getShortWikiText();
		}

} elseif ( ( strtolower( $req->getLabel() ) == 'date' ) && ( $req->getTypeID() == '_dat' ) ) {

		foreach ( $field->getContent() as $entry ) {
				$dates[] = $entry->getXMLSchemaDate();
		}

}

I tried to see if I could figure out a patch but it wasn't obvious to me.


Version: unspecified
Severity: normal

Details

Reference
bz33721

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:00 AM
bzimport set Reference to bz33721.
bzimport added a subscriber: Unknown Object (MLST).

Thanks for reporting this, seems like this issue was introduced in 1.6. Ought to be fixed by r108905 - can you confirm?

Confirmed. Updated to r108922 and it is all good now. Thanks Jeroen!