Closed (won't fix)
Project:
Commerce Core
Version:
7.x-1.0-rc1
Component:
Cart
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Aug 2011 at 16:07 UTC
Updated:
4 Oct 2012 at 21:26 UTC
Jump to comment: Most recent file
Comments
Comment #1
serialjaywalker commentedIs the line item reference field you added single-valued? I could see that causing problems, but I'm still surprised it would happen when deleting line items, rather than when deleting the referencing entities.
Comment #2
andi-d commentedYes, the line item reference Field is single-valued.
The Error comes when i deleting the line item in the shopping cart and when i set the quantity to 0 and update cart
Comment #3
rszrama commentedYeah, the line item module isn't particularly equipped to deal with single value line item reference fields when using the "Line item reference manager" widget. Right now there is no other widget for the field, so this is why you've encountered this issue. Honestly, I can't figure out what you even mean you did based on your original post. Perhaps you can post a screenshot, an exported View, or some better explanation for what you're trying to accomplish? I feel like you may be missing a much simpler solution.
Comment #4
rszrama commented(Updating to a more descriptive title.)
Comment #5
andi-d commentedOk, I think i found my mistake.
My aim was adding new rows to the cart form, for images or some other product fields.
For this I added the line item reference field (see screenshot).
But this field caused the problem with the remove button in the cart form.
My mistake was that i overlooked the commerce line item: referenced produkt relationship in the cart form view, and i thought that is only appears with the line item reference field.
Now, without the field it works fine (second screen).
Comment #6
rszrama commentedAhh, yep. That's what I thought you were trying to do, but I couldn't tell if you were using the referenced product relationship already or not. Glad you got it sorted out.
Comment #7
fearlsgroove commentedcommerce_product_bundle has a use case for this -- the parent line item of a bundle line item. It's impossible to delete these with the api.
Comment #8
rszrama commentedCan you explain what you think needs to happen before we re-open this issue? It could be what the Bundle module needs is just a custom line item reference widget instead of a change incorporating the line item manager widget.
Comment #9
fearlsgroove commentedI'm not sure .. it seems wrong to have widget specific logic wrapped up in the field itself, but then to also only have one widget. It doesn't seem desirable to always delete referenced line items when orphaned, but it doesn't seem like that behavior should require that it be multi-valued, nor should it be restricted only to the widget used.
Maybe it makes the most sense to have the behavior:
1. Tolerate single or multi-value fields (quite straightforward), and
2. Be dependent on a field setting instead of anything to do with the widget. That way Other modules using line item references or fields created with the UI can decide which behavior to use, and modules that don't even need a widget at all don't have to define a null widget just to work when parent entities are deleted.
Comment #10
rszrama commentedMarking this closed (won't fix) because the contributed module http://drupal.org/project/entityreference should more than likely be used in the use case described above instead of the core line item reference field. Part of the roadmap for Commerce 2.x involves making this module a new dependency (especially if it gets into core), and that combined with the Inline Entity Form is going to be the best solution to this problem. The scope of the change is much too wide for the 1.x branch, but you can rest assured we'll sort this out in 2.x.