X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialChangeContentModel.php;h=ccbb2752ba1f1a1f127e5c04bdbe232aedf380d8;hb=813e4e1160bdc677dc4def529a4ecb650a1ad3da;hp=ee9f665bbd36d51a60fcc83042f5e0df986cfe7b;hpb=1ed1cc8769c43b967a7f03ff33bf129318e0eea0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialChangeContentModel.php b/includes/specials/SpecialChangeContentModel.php index ee9f665bbd..ccbb2752ba 100644 --- a/includes/specials/SpecialChangeContentModel.php +++ b/includes/specials/SpecialChangeContentModel.php @@ -84,12 +84,20 @@ class SpecialChangeContentModel extends FormSpecialPage { ], ]; 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' => [ @@ -184,6 +192,7 @@ class SpecialChangeContentModel extends FormSpecialPage { $newContent = ContentHandler::getForModelID( $data['model'] )->makeEmptyContent(); } $flags = $this->oldRevision ? EDIT_UPDATE : EDIT_NEW; + $flags |= EDIT_INTERNAL; if ( $user->isAllowed( 'bot' ) ) { $flags |= EDIT_FORCE_BOT; }