i have disabled billing information for role with the help of Customer Profile Type UI.

but now, on checkout

Notice: Undefined index: commerce_customer_address in commerce_customer_field_widget_form() (line 954 of /home/u4586/domains/makey.u4586.argon.vps-private.net/sites/all/modules/commerce/modules/customer/commerce_customer.module). Backtrace:
commerce_customer_field_widget_form(Array, Array, Array, Array, 'und', Array, 0, Array) field.form.inc:78
field_default_form('commerce_order', Object, Array, Array, 'und', Array, Array, Array) field.attach.inc:209
_field_invoke('form', 'commerce_order', Object, Array, Array, Array) field.attach.inc:386
_field_invoke_default('form', 'commerce_order', Object, Array, Array, Array) field.attach.inc:568
field_attach_form('commerce_order', Object, Array, Array, NULL) commerce_fieldgroup_panes.module:59
commerce_fieldgroup_panes_contents_checkout_form(Array, Array, Array, Object) commerce_checkout.pages.inc:104
commerce_checkout_form(Array, Array, Object, Array) 
call_user_func_array('commerce_checkout_form', Array) form.inc:787
drupal_retrieve_form('commerce_checkout_form_checkout', Array) form.inc:331
drupal_build_form('commerce_checkout_form_checkout', Array) form.inc:123
drupal_get_form('commerce_checkout_form_checkout', Object, Array) commerce_checkout.pages.inc:58
commerce_checkout_router(Object) 
call_user_func_array('commerce_checkout_router', Array) menu.inc:517
menu_execute_active_handler() index.php:21

Comments

rszrama’s picture

Category: bug » support
Status: Active » Fixed

I'm not sure how you're saying you've disabled the billing information, but if you've removed the customer profile reference field from the order or something, you'd also need to disable the checkout pane from the checkout form. You'll find this in your checkout form builder settings. If this fixes it, great, otherwise we'll need more information on what you've done to determine if there's actually a bug in play here or not.

dgastudio’s picture

ok, thanks. i'll try it

dgastudio’s picture

no, sorry.

i'm using http://drupal.org/sandbox/jpayne/1358462 to dynamically disable profile panes using rules.

so, for user role "partner" i want to hide billing information, but for other users show it.

rszrama’s picture

Ahh, well, in that case you should post an issue to that issue queue. : )

dgastudio’s picture

solved by removing line 954 of commerce_customer.module.

rszrama’s picture

Sounds risky to me. : )

I'd still post a bug report to that sandbox module's issue queue, as you shouldn't have to remove that line.

dgastudio’s picture

Project: Commerce Core » Customer Profile Type UI
Version: 7.x-1.x-dev »
Component: Order » Code
Category: support » bug
Status: Fixed » Active

ok, changing.

acrazyanimal’s picture

I see, can you explain in detail what you've done to disable the billing pane? Also, the page(s) where the error occurs?

I see similar errors, but never on checkout. I have been ingnoring them for now, but will have to deal with it soon enough. I have been waiting for more info on a process for deleting customer profile types before I moved this module forward any further. See #1330882: EntityMalformedException : Missing bundle property on entity - after uninstalling modules providing reference fields. Looks like I'll have to invent something.

Anyway, send me some additional info regarding what you're seeing and I'll see if I can help you out.

acrazyanimal’s picture

Project: Customer Profile Type UI » Commerce Core
Version: » 7.x-1.x-dev
Component: Code » Customer
Status: Active » Needs review
StatusFileSize
new1.62 KB

Looks like the issue is infact in the commerce_customer module. The line mentioned above in the error report (line 954 of commerce_customer.module) assumes that all addressfields associated with any profile type should be present on all profile types; it obviously is not. So I've just added a check that the field name is present in the array before trying to access it.

peace!

davidwhthomas’s picture

Here's a similar patch for this same issue.

In my case, I have several commerce customer profile types.

Some of them don't have address fields.

The current code assumes all profiles have an address field, which results in a notice error in the watchdog for each profile on each order.

The patch checks first to ensure the profile has an addressfield prior to processing.

Please commit when possible,

thanks.

DT

acrazyanimal’s picture

lol, ok I don't know why you would submit an identical patch, but yes please somebody commit either one of these patches to fix this issue.

cheers.

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me (either patch) :)

rszrama’s picture

Status: Reviewed & tested by the community » Fixed

heh, nice confluence of patches. Went with the first since they're the same, but I did change it to an empty() check on the actual #language property to prevent an edge case of the array having the field array but missing a #language key.

Commit: http://drupalcode.org/project/commerce.git/commitdiff/8f9a944

Status: Fixed » Closed (fixed)

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