diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2021-02-19 00:52:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2021-02-19 00:52:33 +0000 |
commit | a7a06465bb802dabee050515ef61742aaed160c6 (patch) | |
tree | 635c2898026338b82b3f1b42cd580c76b5a58120 | |
parent | 4ee2dd5c8a7023ae3ef798a76694340cb16c5573 (diff) | |
parent | 20db32143b2a70a2710fd01324bceb5328c5c92c (diff) | |
download | mediawikicore-a7a06465bb802dabee050515ef61742aaed160c6.tar.gz mediawikicore-a7a06465bb802dabee050515ef61742aaed160c6.zip |
Merge "field descriptors in HTMLForm must have keys"
-rw-r--r-- | includes/ProtectionForm.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index e961f2b3f428..d9c5256b9967 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -424,7 +424,7 @@ class ProtectionForm { $options[$this->getOptionLabel( $key )] = $key; } - $fields[] = [ + $fields[$id] = [ 'type' => 'select', 'name' => $id, 'default' => $selected, @@ -465,7 +465,7 @@ class ProtectionForm { } # Add expiry dropdown - $fields[] = [ + $fields["wpProtectExpirySelection-$action"] = [ 'type' => 'select', 'name' => "wpProtectExpirySelection-$action", 'id' => "mwProtectExpirySelection-$action", @@ -479,7 +479,7 @@ class ProtectionForm { # Add custom expiry field if ( !$this->disabled ) { - $fields[] = [ + $fields["mwProtect-expiry-$action"] = [ 'type' => 'text', 'label' => $this->mContext->msg( 'protect-othertime' )->text(), 'name' => "mwProtect-expiry-$action", @@ -504,7 +504,7 @@ class ProtectionForm { # Add raw sections added in buildForm if ( $hookFormRaw ) { - $fields[] = [ + $fields['rawinfo'] = [ 'type' => 'info', 'default' => $hookFormRaw, 'raw' => true, @@ -514,7 +514,7 @@ class ProtectionForm { # JavaScript will add another row with a value-chaining checkbox if ( $this->mTitle->exists() ) { - $fields[] = [ + $fields['mwProtect-cascade'] = [ 'type' => 'check', 'label' => $this->mContext->msg( 'protect-cascade' )->text(), 'id' => 'mwProtect-cascade', @@ -532,7 +532,7 @@ class ProtectionForm { // Subtract arbitrary 75 to leave some space for the autogenerated null edit's summary // and other texts chosen by dropdown menus on this page. $maxlength = CommentStore::COMMENT_CHARACTER_LIMIT - 75; - $fields[] = [ + $fields['wpProtectReasonSelection'] = [ 'type' => 'select', 'cssclass' => 'mwProtect-reason', 'label' => $this->mContext->msg( 'protectcomment' )->text(), @@ -546,7 +546,7 @@ class ProtectionForm { ), 'default' => $this->mReasonSelection, ]; - $fields[] = [ + $fields['mwProtect-reason'] = [ 'type' => 'text', 'id' => 'mwProtect-reason', 'label' => $this->mContext->msg( 'protect-otherreason' )->text(), @@ -557,12 +557,12 @@ class ProtectionForm { ]; # Disallow watching if user is not logged in if ( $this->mUser->isRegistered() ) { - $fields[] = [ + $fields['mwProtectWatch'] = [ 'type' => 'check', 'id' => 'mwProtectWatch', 'label' => $this->mContext->msg( 'watchthis' )->text(), 'name' => 'mwProtectWatch', - 'invert' => !( + 'default' => ( $this->mUser->isWatched( $this->mTitle ) || $this->mUser->getOption( 'watchdefault' ) ), @@ -582,7 +582,7 @@ class ProtectionForm { } if ( !$this->disabled ) { - $fields[] = [ + $fields['wpEditToken'] = [ 'name' => 'wpEditToken', 'type' => 'hidden', 'default' => $this->mUser->getEditToken( [ 'protect', $this->mTitle->getPrefixedDBkey() ] ), |