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.
this is related to #1398448: stock sku consistency on node update/delete but is for consistency with uc_attribute module: when change to model name for a combination is done in attribute stock levels are loose, when removed an adjustment stock table still has it stored.
I'll define another hook, hook_uc_adjustments_updated($nid,$changes) where changes are an array of object with properties model and newmodel, with newmodel setted to false for removed
Comment | File | Size | Author |
---|---|---|---|
#6 | ubercart-stock-attributes-consistency-1415590-6.patch | 2.52 KB | smartango |
#1 | ubercart-stock-attributes-consistency-1415590.patch | 2.55 KB | smartango |
Comments
Comment #1
smartango CreditAttribution: smartango commentedthe patch that solve the issue
Comment #2
smartango CreditAttribution: smartango commentedmaybe it is better to add form #submit handler (form_alter in uc_stock), also a form #validate (in uc_attributes) to check sku duplication in uc_product_adjustments and product table
Comment #3
smartango CreditAttribution: smartango commentedCan I have audience here? This is really a problem, users change sku on adjustments.
Really no one have this problem?
when I'll post a test that fail this could be taken into account?
Comment #4
debo7debo CreditAttribution: debo7debo commented#1: ubercart-stock-attributes-consistency-1415590.patch queued for re-testing.
Comment #6
smartango CreditAttribution: smartango commentedI re-send the patch, this could be arguable, the old value could be stored in form state (and no by additional query in form_submit), and also the implementation could entirely rely on uc_stock module using form alter and submit handler (form api).
But this works ... (actually the relative test is missing)
Comment #7
smartango CreditAttribution: smartango commentedclosed as duplicated of #1398448: stock sku consistency on node update/delete