if ( !isset( $attribs['title'] )
&& isset( $row->ar_namespace )
- && isset( $row->ar_title ) ) {
-
+ && isset( $row->ar_title )
+ ) {
$attribs['title'] = Title::makeTitle( $row->ar_namespace, $row->ar_title );
}
/**
* Returns the content model for this revision.
*
- * If no content model was stored in the database, $this->getTitle()->getContentModel() is
+ * If no content model was stored in the database, the default content model for the title is
* used to determine the content model to use. If no title is know, CONTENT_MODEL_WIKITEXT
* is used as a last resort.
*
public function getContentModel() {
if ( !$this->mContentModel ) {
$title = $this->getTitle();
- $this->mContentModel = ( $title ? $title->getContentModel() : CONTENT_MODEL_WIKITEXT );
+ if ( $title ) {
+ $this->mContentModel = ContentHandler::getDefaultModelFor( $title );
+ } else {
+ $this->mContentModel = CONTENT_MODEL_WIKITEXT;
+ }
assert( !empty( $this->mContentModel ) );
}
$row['content_format'] = $current->rev_content_format;
}
+ $row['title'] = Title::makeTitle( $current->page_namespace, $current->page_title );
+
$revision = new Revision( $row );
- $revision->setTitle( Title::makeTitle( $current->page_namespace, $current->page_title ) );
} else {
$revision = null;
}