We are using fieldgroup panes to expose a bunch of fields on the checkout orm to collect donor comments amongst other things. However, we only want this checkout pane to be present if a certain 'donation' product type is in the cart. So, in hook_form_FORMID_alter we unset the entire fieldgroup unset($form['commerce_fieldgroup_pane__group_cw_fundraising_comments|commerce_order|commerce_order|form']);

However, this causes the checkout process to die with a wsod as the submit handler tries to call field_attach_submit() passing in $form[$checkout_pane['pane_id']] which is expected to be an array- in our case it's not set as we unset it.

Comments

mrfelton’s picture

Title: Checkout process dies a horrible death if a checkout_fieldgroup_pane has been removed from the checkout form. » Checkout process dies a horrible death if a commerce_fieldgroup_pane has been removed from the checkout form.
Status: Active » Needs review
StatusFileSize
new1.12 KB

Attached patch adds an additional check to only run the submission handler routines if the pane actually exists.

summit’s picture

Status: Needs review » Reviewed & tested by the community

Hi, This works great!
Greetings, Martijn

pcambra’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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