],
];
if ( $this->title ) {
+ $options = $this->getOptionsForTitle( $this->title );
+ if ( empty( $options ) ) {
+ throw new ErrorPageError(
+ 'changecontentmodel-emptymodels-title',
+ 'changecontentmodel-emptymodels-text',
+ $this->title->getPrefixedText()
+ );
+ }
$fields['pagetitle']['readonly'] = true;
$fields += [
'model' => [
'type' => 'select',
'name' => 'model',
- 'options' => $this->getOptionsForTitle( $this->title ),
+ 'options' => $options,
'label-message' => 'changecontentmodel-model-label'
],
'reason' => [
$newContent = ContentHandler::getForModelID( $data['model'] )->makeEmptyContent();
}
$flags = $this->oldRevision ? EDIT_UPDATE : EDIT_NEW;
+ $flags |= EDIT_INTERNAL;
if ( $user->isAllowed( 'bot' ) ) {
$flags |= EDIT_FORCE_BOT;
}