Needs review
Project:
Ubercart
Version:
7.x-3.x-dev
Component:
Stock
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Aug 2011 at 17:39 UTC
Updated:
28 Feb 2016 at 04:26 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
douglasmiller commentedI was very surprised to find that hook_uc_stock_adjusted was not fired when an admin manually adjusts the stock. This seems contrary to the intent of the hook.
I have adjusted uc_stock.admin.inc to invoke the hook with the correct values upon form submission.
Comment #2
douglasmiller commentedThe above patch fires for all save events on a node's edit/stock page.
This may not always be desirable, so I have created this new patch that will only invoke the hook if the stock management is set to active.
Comment #3
SilviuChingaru commentedI think the hook should be called on every stock update not only for active stocks. Maybe we want to keep track of units without decreasing the stock
Comment #4
SilviuChingaru commentedI think this is a bug not a feature request because hook_uc_stock_adjusted() should and is docomented as the hook that is called on any stock adjustment.
Comment #5
longwaveWe should fire the hook for all variants, but only when the stock level actually changes.
Comment #6
tr commentedUploading the patch in #5 again for the new testbot to see. It still applies, and no changes were made.