I installed DrupalCommerce but most boxes were greyed out as Rules and Entity were needed. I don't see these listed anywhere as dependencies though??

When I installed Entity - I got this message:

Error message
FieldException: Attempt to create a field of unknown type commerce_line_item_reference. in field_create_field() (line 298 of mysite\drupal7\modules\field\field.crud.inc).

Followed by:

* Notice: Undefined index: teaser in _field_write_instance() (line 799 of C:\web\drupal7\modules\field\field.crud.inc).
* Notice: Undefined index: teaser in _field_write_instance() (line 799 of C:\web\drupal7\modules\field\field.crud.inc).

Comments

bojanz’s picture

Title: Notices when installing Product Reference » error when installing Entity
Priority: Minor » Critical

Got the same error when installing from scratch (Ryan's github branch of Commerce, latest CVS of Rules and Entity).

Also got the above mentioned notices when enabling Product Reference (and Cart and Checkout along with it).

The notices are thrown from here:

// If no weight specified, make sure the field sinks at the bottom.
if (!isset($display['weight'])) {
  $weights = array();
  foreach (field_info_instances($instance['entity_type'], $instance['bundle']) as $existing_instance) {
    if ($instance['field_name'] != $existing_instance['field_name']) {
      $weights[] = $existing_instance['display'][$view_mode]['weight'];
    }
  }
  foreach (field_extra_fields($instance['entity_type'], $instance['bundle'], 'display') as $extra) {
    $weights[] = $extra['display'][$view_mode]['weight'];
  }
  $display['weight'] = $weights ? max($weights) + 1 : 0;
}

With the offending line being:

$weights[] = $existing_instance['display'][$view_mode]['weight'];

My Drupal instance is a few weeks old, and I remember you making changes for alpha6, so maybe updating to a newer HEAD would fix this.

bojanz’s picture

I also get the following in the Cart view:

Debug: 'Missing handler: field_data_line_items line_items_line_item_id relationship' in views_get_handler() (line 724 of /home/bojan/public_html/drupal/sites/all/modules/views/views.module).

Which might be related to the first error...

bojanz’s picture

Title: error when installing Entity » Notices when installing Product Reference
Priority: Critical » Minor

Installed latest D7 HEAD, and all the latest modules.
The critical error is no longer there.

However, the two notices remain.

rszrama’s picture

Title: error when installing Entity » Notices when installing Product Reference
Priority: Critical » Minor

This still an issue?

bojanz’s picture

@rszrama
As far as I know, they are gone (it was due to Entity, you found it on irc, fago said in his own queue that it's fixed).

I will do a reinstall to confirm.

rszrama’s picture

Status: Active » Fixed

As best as I can tell, the notices were coming from the creation of Price fields and a Product Reference field on the installation of the Product and Product Reference modules. I've updated the code to use the proper view modes when creating these fields, because the Product Reference field creation was using an outdated view mode and the Price field creation wasn't changing the view modes specified based on the type of entity the field was being added to. See the fix here:

http://github.com/rszrama/drupalcommerce/commit/1202c6a8fa4749984727b9b9...

Committing to CVS now so it can be tested. Use the latest versions of Views, Entity, and Rules, too.

Status: Fixed » Closed (fixed)

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

aristeides’s picture

using the latest dev versions of everything (including core) I'm still getting these notices...

rfay’s picture

@aristeides, I imagine you have a failed install, where some fields were not successfully created.

You can figure out where the messages are coming from with the Commerce Devel module. But it's likely you'll have to uninstall and reinstall all commerce related modules. #858722: Cannot reinstall Commerce modules after uninstall due to field deletion failure, which I think you're in, has information about how to do a manual uninstall.