On my site the Billing Information pane has been disabled during checkout, because all of the billing is handled by the external

When the Commerce Google Analytics module is enabled, there is an error during checkout:

Error message
EntityMetadataWrapperException: Unable to get the data property profile_id as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (line 442 of /home/ubuntu/commerce_kickstart-7.x-1.8/profiles/commerce_kickstart/modules/entity/includes/entity.wrapper.inc).

The site was installed with the Commerce Kickstart profile, and the error appears in both 7.x-1.0-rc2 and -dev.

There are some other related modules installed such as Commerce Extra Panes, however disabling them seems to have no effect, while disabling CGA gets rid of the error.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

forssto’s picture

Status: Active » Needs review
FileSize
1.54 KB

Ran into this as well. Here's a patch that should make it work. It still defaults to the billing address, but falls back to shipping. If even that isn't found, it just sends empty strings as the location parameters.

stella’s picture

Patch reroll with the following changes:

  • There was a bug with the check to load the address information - it only happened if no profile was found
  • The code wouldn't work on a multilingual site where the language code may not always be LANGUAGE_NONE.
  • The address information sent to Google Analytics contained the country code rather than the name (e.g. IE rather than Ireland) and no state information.
jessepinho’s picture

Can confirm that #2 works for me. Can we get this committed? This is a huge issue.

mrfelton’s picture

Previous patch assumes that commerce shipping is installed, and results in fata errors if no. Updated patch caters for the case where it isn't (added extra isset() check).

Cyberschorsch’s picture

Status: Needs review » Fixed

Commited in new 7.10 release

Cyberschorsch’s picture

Status: Fixed » Closed (fixed)