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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

smartango’s picture

Status: Active » Needs review
FileSize
2.55 KB

the patch that solve the issue

smartango’s picture

maybe 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

smartango’s picture

Can 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?

debo7debo’s picture

Status: Needs review » Needs work

The last submitted patch, ubercart-stock-attributes-consistency-1415590.patch, failed testing.

smartango’s picture

I 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)

smartango’s picture

Status: Needs work » Closed (duplicate)