jenkins-bot has submitted this change and it was merged.

Change subject: Fix HTMLForm noData logic in trySubmit
......................................................................


Fix HTMLForm noData logic in trySubmit

This was missed in If4e0dfb and causes missing array key warnings
for fields using skipLoadData.

Change-Id: Ib52ee2bc9af278f03b48730acc1edb30f5ff1f88
---
M includes/htmlform/HTMLForm.php
M includes/htmlform/HTMLFormFieldCloner.php
2 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Anomie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php
index d671029..9cad7bf 100644
--- a/includes/htmlform/HTMLForm.php
+++ b/includes/htmlform/HTMLForm.php
@@ -569,7 +569,7 @@
 
                # Check for cancelled submission
                foreach ( $this->mFlatFields as $fieldname => $field ) {
-                       if ( !empty( $field->mParams['nodata'] ) ) {
+                       if ( !array_key_exists( $fieldname, $this->mFieldData ) 
) {
                                continue;
                        }
                        if ( $field->cancelSubmit( 
$this->mFieldData[$fieldname], $this->mFieldData ) ) {
@@ -580,7 +580,7 @@
 
                # Check for validation
                foreach ( $this->mFlatFields as $fieldname => $field ) {
-                       if ( !empty( $field->mParams['nodata'] ) ) {
+                       if ( !array_key_exists( $fieldname, $this->mFieldData ) 
) {
                                continue;
                        }
                        if ( $field->isHidden( $this->mFieldData ) ) {
diff --git a/includes/htmlform/HTMLFormFieldCloner.php 
b/includes/htmlform/HTMLFormFieldCloner.php
index 3f80884..ec1bd84 100644
--- a/includes/htmlform/HTMLFormFieldCloner.php
+++ b/includes/htmlform/HTMLFormFieldCloner.php
@@ -207,7 +207,7 @@
                foreach ( $values as $key => $value ) {
                        $fields = $this->createFieldsForKey( $key );
                        foreach ( $fields as $fieldname => $field ) {
-                               if ( !empty( $field->mParams['nodata'] ) ) {
+                               if ( !array_key_exists( $fieldname, $value ) ) {
                                        continue;
                                }
                                if ( $field->cancelSubmit( $value[$fieldname], 
$alldata ) ) {
@@ -237,7 +237,7 @@
                foreach ( $values as $key => $value ) {
                        $fields = $this->createFieldsForKey( $key );
                        foreach ( $fields as $fieldname => $field ) {
-                               if ( !empty( $field->mParams['nodata'] ) ) {
+                               if ( !array_key_exists( $fieldname, $value ) ) {
                                        continue;
                                }
                                $ok = $field->validate( $value[$fieldname], 
$alldata );

-- 
To view, visit https://gerrit.wikimedia.org/r/286499
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib52ee2bc9af278f03b48730acc1edb30f5ff1f88
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: GergÅ‘ Tisza <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to