Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I think that we'd need to provide a delete link for line item types, but probably restrict it only to those provided by this module as it won't make any sense to delete code-provided line item types. They would just reappear as if nothing happened.
Comment | File | Size | Author |
---|---|---|---|
#3 | 1329190-allow_delete_line_item_types-3.patch | 7.51 KB | pcambra |
Comments
Comment #1
rfayDefinitely. Thought I'd already opened this issue :-) - There's even commented-out code for this.
The complexity is that line item types that have content shouldn't be deleted. So it needs that code.
Comment #2
ryan.gibson CreditAttribution: ryan.gibson commentedyep.
Subscribe.
Comment #3
pcambraHere's an initial patch that includes the basic functionality for the delete.
I'd appreciate some testing prior to commit this.
I think we'd probably need to adapt the code to be in different files (types.inc and forms.inc) for edit and delete the same way that product ui does before putting this into commerce itself.
Also we probably need some breadcrumb magic :) but this is good to go after some review.
I'm also including some basic fixes as labels and so.
Comment #4
rfayI haven't tested this, but a read-through of the patch looks like it does what needs to be done. Thanks for the cleanup too.
Line items in the comment, of course.
Comment #5
rfayJust gave it a test drive and it looks good to me.
Note that dangling references to the old line type in the display settings of a content type will cause ugly entity exceptions. But I think this is true everywhere.
Comment #6
pcambraOoops thanks :)
Reviewed and commited!
Comment #8
sibiru CreditAttribution: sibiru commentedHi, sorry to open this issue again.
I need help how to delete custom line item type
I got this message
How to find the product that has this line item type?
I've tried using Views but cannot delete it but it wont works
Exported Views