Problem/Motivation

Trying to add the commerce webform order in a site having a commerce order item type with bundle fields, it appears this warning: "Warning: Undefined array key "#type" en Drupal\Core\Form\FormHelper::processStates() "

Steps to reproduce

1. Have a site with an order item type with bundle fields . It can happen also if it has just extra base fields.
2. Add commerce order Webform handler (it needs to be applied the patch from this issue first).

Proposed resolution

Fix this part of the code, because is adding the states in the key "$form['tabs_wrapper']['order_item'][$order_item_id][$field_id]" instead of "$form['tabs_wrapper']['order_item']['bundles'][$order_item_id][$field_id]".

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

omarlopesino created an issue. See original summary.

omarlopesino’s picture

Title: Mensaje Warning: Undefined array key "#type" en Drupal\Core\Form\FormHelper::processStates() » Warning: Undefined array key "#type" en Drupal\Core\Form\FormHelper::processStates()
omarlopesino’s picture

Status: Active » Needs review
StatusFileSize
new830 bytes

Created a branch (can't create MR), and attached a patch. Please review, thanks!

  • facine committed 653703cc on 3.x authored by omarlopesino
    Issue #3396580 by omarlopesino: Warning: Undefined array key "#type" en...
facine’s picture

Status: Needs review » Fixed

Fixed, thank you!

Please download and review the latest dev release.

omarlopesino’s picture

Thanks! I confirm that the latest dev release fixes the problem and the warning does not appear anymore.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

wisneskit changed the visibility of the branch 3396580-warning-undefined-array to hidden.