Describe your bug or feature request.

I just upgraded to Commerce 3.2.0 from 2.40 and tried using the new OrderItemsWidget.
I'm getting a WSOD on the order edit form, with the following error:

TypeError: array_merge(): Argument #2 must be of type array, null given in array_merge() (line 297 of modules/contrib/commerce/modules/order/src/Plugin/Field/FieldWidget/OrderItemsWidget.php).

For some reason on this project $form['submit'] exists and has just a #weight, no #submit key, causing the array_merge call to fail.

On another project $form['submit'] is NULL, not really sure what's actually causing the key to be set in one case and not the other.

Issue fork commerce-3552867

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

jsacksick created an issue. See original summary.

jsacksick’s picture

Issue summary: View changes
tbkot’s picture

Status: Active » Needs review
StatusFileSize
new1.69 KB

Here is the patch with the updated logic to add a custom submit callback to the main entity action

tbkot’s picture

StatusFileSize
new1.92 KB

Fixing the typo in the previous patch

jsacksick’s picture

StatusFileSize
new1.54 KB
jsacksick’s picture

StatusFileSize
new1.61 KB
jsacksick’s picture

Status: Needs review » Fixed

Went with the approach from the MR.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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