Use current content model for blank page content (not title default)
authorBrian Wolff <bawolff+wn@gmail.com>
Thu, 21 Jul 2016 21:37:08 +0000 (21:37 +0000)
committerBrian Wolff <bawolff+wn@gmail.com>
Thu, 21 Jul 2016 21:46:48 +0000 (21:46 +0000)
This means that if you specify ?model=MODEL_ID you can create a
page using the non-default content model (but only if you have
the correct rights. Admin by default). Previously this only worked
if you specified a preload parameter that had the content model
that you wanted.

Additionally, I believe that this makes more sense logically in
terms of using the class state instead of the global state for
the current content model.

Change-Id: I938be1abcae8ac0b5fdb82d0d57bad5526aa5dee

includes/EditPage.php

index fa74103..79c8b51 100644 (file)
@@ -1286,7 +1286,7 @@ class EditPage {
                        return $this->mPreloadContent;
                }
 
-               $handler = ContentHandler::getForTitle( $this->getTitle() );
+               $handler = ContentHandler::getForModelID( $this->contentModel );
 
                if ( $preload === '' ) {
                        return $handler->makeEmptyContent();