Make sure product is licensed before creating license

Created on 5 May 2017, over 8 years ago
Updated 19 August 2025, 5 days ago

In commerce_license_commerce_line_item_presave() we create the license to be associated with the line item. We check to make sure the line item is licensable, but do not check to make sure the product of said line item is a licensed product.

In my case, I had a common line item type could contain both licensed and non-licensed products. When using inline entity form as my line item manager and adding a product that's not licensable to an order, uncaught exceptions ensued.

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States andyg5000 North Carolina, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024