Closed (won't fix)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Line item
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
23 Jul 2015 at 20:29 UTC
Updated:
12 Aug 2015 at 02:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mglamanPatch.
Comment #2
rszrama commentedI'm inclined to leave this as is. The same is true for all of our *_new() helper functions - they really exist just to initialize values. The caller is really responsible for setting all of the appropriate values prior to saving the object, we just don't force a type to be passed to this helper function. For example, you wouldn't be able to save a product without setting a SKU, but we don't even accept a SKU in the commerce_product_new() signature.
Happy to reconsider this, but I'm not sure it's worth changing the general philosophy of Commerce 1.x w/ respect to not being particularly defensive in our API functions at this point.