I just rebuild my dev environment (fetch commercedev, drush make it, install it), and after install and on every page I get:

Notice: Undefined index: und in commerce_product_line_item_populate() (line 1100 of /commerce/profiles/commercedev/modules/contrib/commerce/modules/product_reference/commerce_product_reference.module).

It's this code:

  // Set the unit price on the line item object.
  $line_item->unit_price = array(
    $language => array(
      array(
        'amount' => $product->purchase_price[$language][0]['amount'],
        'currency_code' => $product->purchase_price[$language][0]['currency_code'],
      )
    )
  );

And for some reason, $product->purchase_price is an empty array().

Comments

bojanz’s picture

Title: Notice in commerce_product_line_item_populate() » The commercedev install profile is kinda broken

Also, clicking on "Add to cart" for any product gives the error:

EntityMetadataWrapperException: Invalid data value given. Be sure it matches the required data type and format. in EntityMetadataWrapper->set() (line 111 of /commerce/profiles/commercedev/modules/contrib/entity/includes/entity.wrapper.inc).

And the product nodes in admin show the language as "Undefined language ()", I checked, their language column in the node table is empty.

rszrama’s picture

It's probably just a version sync problem... I don't ever use drush make, so I don't know how to tell which versions it's installing, but I wonder if it isn't getting my latest dev on GitHub. It works fine if I use the installation profile on a site with the latest dev versions of everything on Drupal 7.x-1.0.

pcambra’s picture

I had this same error yesterday after the field naming changes but updating the commercedev profile to the latest vestion from github solved it.

bojanz’s picture

Status: Active » Fixed

Yup. I replaced commerce with the version from ryan's github, reinstalled, and it's okay now. Thanks
I love it when problems fix themselves :P :)

abulte’s picture

I did a fresh checkout of the profile from GIT today, fresh install too, and I have the same errors : Notice : Undefined index: und dans commerce_product_line_item_populate() right after install.

Any idea ?

Thanks.

abulte’s picture

Status: Fixed » Active
adiatis’s picture

Status: Active » Fixed

Ok, github version solved my problem. Thx

abulte’s picture

Status: Fixed » Active

@adiatis : maybe it solved yours, but not mine...

rszrama’s picture

Status: Active » Fixed

The dev version of Commerce here had gotten out of sync w/ my Git repo which is what Commerce Dev is kept synchronized with. I'm guessing that resolved issues for some people, and additionally I've converted all instances of hard-coded LANGUAGE_NONE to use entity_metadata_wrapper()... this should all be resolved now.

mthart’s picture

I have been having these same install issues today.

The first time around, I downloaded the commerce modules from Drupal.org and the install profile form GitHub, and I received this message while installing after 22 of 59 steps had completed:

"An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://commerce.localhost:8082/install.php?profile=commercedev&locale=en... StatusText: OK ResponseText: Notice: Undefined index: label in /Users/Michael/Sites/commerce/sites/all/modules/rules/modules/rules_core.rules.inc on line 125 {"status":true,"percentage":"37","message":"Completed 22 of 59.\u003cbr \/\u003eInstalled \u003cem\u003eOrder\u003c\/em\u003e module."}"

Watching it closely, it looks like it installs the Entity module, then gets to the Customer module, and then throws the error.

As you might be able to see, I am installing it under DAMP on OSX 10.6.6 (through Firefox 4.0b11).

After reading this thread, I downloaded the commerce module from Github and tried again, but got the same error.

I am also using the dev version of all the dependent modules as of today's date.

Any ideas as to the problem?

mthart’s picture

Priority: Minor » Normal
Status: Fixed » Active

reopening due to my install error above...

rszrama’s picture

Status: Active » Closed (works as designed)

I'm pretty sure these issues are always related to dependencies. Update to the latest Rules and that error will go away.

mthart’s picture

I've tried both the dev and alpha5 versions of rules, and still get that error. I am also using D7.0 btw.

I'll try doing a complete reinstall of everything from the ground up to see if that matters, but to be clear, use latest dev versions of ALL dependent modules?

pcambra’s picture

This is a rules problem that has been solved in #1068094: rules_rules_core_data_info() supposes taxonomy module as installed, please update rules to the last dev or use the patch in the issue.