fix handling of per-revision content model if different from title's default content...
[lhc/web/wiklou.git] / includes / WikiPage.php
index 3088131..6105637 100644 (file)
@@ -353,8 +353,8 @@ class WikiPage extends Page {
     public function getContentModelName() {
         if ( $this->exists() ) {
             # look at the revision's actual content model
-            $content = $this->getContent();
-            return $content->getModelName();
+            $rev = $this->getRevision();
+            return $rev->getContentModelName();
         } else {
             # use the default model for this page
             return $this->mTitle->getContentModelName();
@@ -2271,6 +2271,8 @@ class WikiPage extends Page {
 
                $this->updateCategoryCounts( array(), $cats );
 
+        #TODO: move this to an Update object!
+
                # If using cascading deletes, we can skip some explicit deletes
                if ( !$dbw->cascadingDeletes() ) {
                        $dbw->delete( 'revision', array( 'rev_page' => $id ), __METHOD__ );