The setup:

- A custom node with a line item reference field in it. The field is populated using rules.
- A user account I want to delete, using the "Delete the user and all of its content" option.
- This user is the author of at least one of the above mentioned custom nodes.

The issue:

Trying to delete the user results in the following PHP fatal error:

Call to undefined method EntityDrupalWrapper::count() in /var/www/clients/client68/web260/web/profiles/commerce_kickstart/modules/commerce/modules/line_item/commerce_line_item.module on line 363

Interestingly, if I disable the line item manager widget for the field (so I choose "Do not show a widget"), the problem disappears.

Additional info:

Apart from this issue, the line item reference field works correctly: if I just view one these nodes, I can see the correct line item showing up, so this is probably not because of an incorrect reference.

PS

Thanks for all your efforts developing Drupal Commerce! Keep up good work!

Comments

Seems this is the same problem reported in #1804176: Call to undefined method EntityDrupalWrapper::count() in commerce\modules\line_item\commerce_line_item.module on line 363. If so, let's mark that other one a duplicate of this one, since this one actually has a lead to pursue.

Ryan,

Yes, it is probably the same problem (even if the setup is slightly different). Let me know if you need any more info from me.

Version:7.x-1.3» 7.x-1.x-dev
Status:Active» Fixed

Ok, revisiting this, what you have is honestly not a great scenario. I'd never use the line item manager widget outside of the order context; it just isn't really designed for that. However, we can still accommodate single value line item reference fields in that implementation of hook_field_attach_delete().

Commit: http://drupalcode.org/project/commerce.git/commitdiff/2aa1947

Thanks for the fix!

Status:Fixed» Closed (fixed)

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