Merge "tests: enable MariaDB/MySQL strict mode"
[lhc/web/wiklou.git] / includes / specials / SpecialEditTags.php
index 6198a84..5203807 100644 (file)
@@ -75,8 +75,11 @@ class SpecialEditTags extends UnlistedSpecialPage {
                $this->setHeaders();
                $this->outputHeader();
 
-               $this->getOutput()->addModules( [ 'mediawiki.special.edittags',
-                       'mediawiki.special' ] );
+               $output->addModules( [ 'mediawiki.special.edittags' ] );
+               $output->addModuleStyles( [
+                       'mediawiki.interface.helpers.styles',
+                       'mediawiki.special'
+               ] );
 
                $this->submitClicked = $request->wasPosted() && $request->getBool( 'wpSubmit' );
 
@@ -206,8 +209,6 @@ class SpecialEditTags extends UnlistedSpecialPage {
         * the user to modify the tags applied to those items.
         */
        protected function showForm() {
-               $userAllowed = true;
-
                $out = $this->getOutput();
                // Messages: tags-edit-revision-selected, tags-edit-logentry-selected
                $out->wrapWikiMsg( "<strong>$1</strong>", [
@@ -222,7 +223,6 @@ class SpecialEditTags extends UnlistedSpecialPage {
                $numRevisions = 0;
                // Live revisions...
                $list = $this->getList();
-               // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
                for ( $list->reset(); $list->current(); $list->next() ) {
                        $item = $list->current();
                        $numRevisions++;
@@ -239,9 +239,6 @@ class SpecialEditTags extends UnlistedSpecialPage {
 
                // Show form if the user can submit
                if ( $this->isAllowed ) {
-                       $conf = $this->getConfig();
-                       $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD;
-
                        $form = Xml::openElement( 'form', [ 'method' => 'post',
                                        'action' => $this->getPageTitle()->getLocalURL( [ 'action' => 'submit' ] ),
                                        'id' => 'mw-revdel-form-revisions' ] ) .
@@ -258,9 +255,9 @@ class SpecialEditTags extends UnlistedSpecialPage {
                                                        'id' => 'wpReason',
                                                        // HTML maxlength uses "UTF-16 code units", which means that characters outside BMP
                                                        // (e.g. emojis) count for two each. This limit is overridden in JS to instead count
-                                                       // Unicode codepoints (or 255 UTF-8 bytes for old schema).
+                                                       // Unicode codepoints.
                                                        // "- 155" is to leave room for the auto-generated part of the log entry.
-                                                       'maxlength' => $oldCommentSchema ? 100 : CommentStore::COMMENT_CHARACTER_LIMIT - 155,
+                                                       'maxlength' => CommentStore::COMMENT_CHARACTER_LIMIT - 155,
                                                ] ) .
                                        '</td>' .
                                "</tr><tr>\n" .
@@ -314,7 +311,6 @@ class SpecialEditTags extends UnlistedSpecialPage {
                        // Otherwise, use a multi-select field for adding tags, and a list of
                        // checkboxes for removing them
 
-                       // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
                        for ( $list->reset(); $list->current(); $list->next() ) {
                                $currentTags = $list->current()->getTags();
                                if ( $currentTags ) {
@@ -379,7 +375,6 @@ class SpecialEditTags extends UnlistedSpecialPage {
 
        /**
         * UI entry point for form submission.
-        * @throws PermissionsError
         * @return bool
         */
        protected function submit() {