/** @var bool */
public $bot = true;
- /** @var null|string */
- public $contentModel = null;
+ /** @var string */
+ public $contentModel;
/** @var null|string */
public $contentFormat = null;
}
$revision = $this->mArticle->getRevisionFetched();
if ( $revision === null ) {
- if ( !$this->contentModel ) {
- throw new RuntimeException( 'EditPage contentModel was false' );
- }
$handler = ContentHandler::getForModelID( $this->contentModel );
-
return $handler->makeEmptyContent();
}
$content = $revision->getContent( Revision::FOR_THIS_USER, $user );
$content = $rev ? $rev->getContent( Revision::RAW ) : null;
if ( $content === false || $content === null ) {
- if ( !$this->contentModel ) {
- throw new RuntimeException( 'EditPage contentModel was false' );
- }
$handler = ContentHandler::getForModelID( $this->contentModel );
-
return $handler->makeEmptyContent();
} elseif ( !$this->undidRev ) {
// Content models should always be the same since we error
}
public function setHeaders() {
- global $wgOut, $wgUser, $wgAjaxEditStash, $wgCookieSetOnAutoblock;
+ global $wgOut, $wgUser, $wgAjaxEditStash;
$wgOut->addModules( 'mediawiki.action.edit' );
- if ( $wgCookieSetOnAutoblock === true ) {
- $wgOut->addModules( 'mediawiki.user.blockcookie' );
- }
$wgOut->addModuleStyles( 'mediawiki.action.edit.styles' );
if ( $wgUser->getOption( 'showtoolbar' ) ) {