Trying to use the row data is problematic since the text related
fields are missing. This fixing a regression from
4475e1c8c.
Also make SpecialNewpages::feedItemDesc() handle null content.
Bug: T173541
Change-Id: I2213675d3392c6e9761bdc7acde35fd1caee4517
}
protected function feedItemDesc( $row ) {
}
protected function feedItemDesc( $row ) {
- $revision = $this->revisionFromRcResult( $row );
- if ( $revision ) {
- // XXX: include content model/type in feed item?
- return '<p>' . htmlspecialchars( $revision->getUserText() ) .
- $this->msg( 'colon-separator' )->inContentLanguage()->escaped() .
- htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
- "</p>\n<hr />\n<div>" .
- nl2br( htmlspecialchars( $revision->getContent()->serialize() ) ) . "</div>";
+ $revision = Revision::newFromId( $row->rev_id );
+ if ( !$revision ) {
+ return '';
+ $content = $revision->getContent();
+ if ( $content === null ) {
+ return '';
+ }
+
+ // XXX: include content model/type in feed item?
+ return '<p>' . htmlspecialchars( $revision->getUserText() ) .
+ $this->msg( 'colon-separator' )->inContentLanguage()->escaped() .
+ htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
+ "</p>\n<hr />\n<div>" .
+ nl2br( htmlspecialchars( $content->serialize() ) ) . "</div>";
}
protected function getGroupName() {
}
protected function getGroupName() {