if ( !$this->title ) {
$form->setMethod( 'GET' );
}
+
+ $this->addHelpLink( 'Help:ChangeContentModel' );
+
+ // T120576
+ $form->setSubmitTextMsg( 'changecontentmodel-submit' );
}
public function validateTitle( $title ) {
],
];
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' => [
$flags |= EDIT_FORCE_BOT;
}
- $log = new ManualLogEntry( 'contentmodel', 'change' );
+ $log = new ManualLogEntry( 'contentmodel', $this->oldRevision ? 'change' : 'new' );
$log->setPerformer( $user );
$log->setTarget( $this->title );
$log->setComment( $data['reason'] );