When installing and enabling the product bundle, I get this error everytime

Fatal error: Unsupported operand types in /var/www/drupal/modules/field/field.crud.inc on line 595

Comments

JGO’s picture

I tracked it down to this place in the code:

function commerce_product_bundle_configure_line_item() {


  if (empty($instance)) {
    $instance = array(
      'field_name' => $field_name,
      'entity_type' => 'commerce_line_item',
      'bundle' => 'bundle',
      'label' => t('Parent Line Item'),
      'required' => TRUE,
      'settings' => array(),

      'widget' => array(
        'type' => 'commerce_line_item_manager',
        'weight' => -10,
      ),

      'display' => array(
        'display' => array(
          'label' => 'hidden',
        ),
        'weight' => -10,
      ),
    );
    field_create_instance($instance);

JGO’s picture

Commenting out both "weight" properties seems to fix the error ...

jaxon77’s picture

Just had the same error when I enabled it.

kbalderson’s picture

subscribing...

vthirteen’s picture

same here

vthirteen’s picture

same here
the following notice is subsequently printed on modules page
Notice: Undefined index: weight en field_info_max_weight() (line 799 of /[drupal-root]/modules/field/field.info.inc

axel pressbutton’s picture

Subscribing

carn1x’s picture

Trying to install, using Commerce 7.x-1.0-rc2, I get the following error:

$ drush en commerce_product_bundle
The following extensions will be enabled: commerce_product_attributes, commerce_product_bundle
Do you really want to continue? (y/n): y
Drush command terminated abnormally due to an unrecoverable error.                                                               [error]
Error: Unsupported operand types in modules/field/field.crud.inc, line 595

Trying to view any pages that output product fields provides the error:

PHP Fatal error:  Call to a member function value() on a non-object in sites/all/modules/commerce_product_attributes/commerce_product_attributes.module on line 100

"Fix" in #1 helps the module install without error, however the Fatal error on product pages after remains.

Babalu’s picture

subscribing

ewyglend’s picture

subscribing, same issue here

jawi’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.x-dev
Assigned: Unassigned » jawi

same issue here.

fall_0ut’s picture

subscribing

Anonymous’s picture

Subscribing

olafkarsten’s picture

Status: Active » Needs review
StatusFileSize
new882 bytes

This is actually a core issue http://drupal.org/node/1001624

But there is a workaround in explicit setting the weight value when create the field instance. The patch should solve this - I hope.

olafkarsten’s picture

StatusFileSize
new714 bytes

sorry, patch in #14 misformatted, this patch should work now.

hunziker’s picture

Status: Needs review » Fixed

It is committed.

Status: Fixed » Closed (fixed)

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