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.
problem appears in following situation
create product
set stock values
update product with new SKU
visit stock
values have been lost
some other issues that a proposed patch might solve
#737790: Products SKU update did not transfer correctly to Stock (uc_stock) module
#423262: Stock information not deleted with node
Comment | File | Size | Author |
---|---|---|---|
#14 | 745912_14_uc_product_update_sku_for_stock.patch | 926 bytes | GiorgosK |
#1 | 745912_uc_product_update_sku_for_stock.patch | 818 bytes | GiorgosK |
Comments
Comment #1
GiorgosKThe patch updates stock table when product is updated
at the end of "uc_product_update" function
Comment #2
GiorgosKthis might be a better title
Comment #3
Exploratus CreditAttribution: Exploratus commentedI tried it and it ubercart still resets the stock.... Doesnt work...
Comment #4
GiorgosKyou tried it with what version
the patch was for 2.2
please make your report as helpful as possible
Comment #5
Exploratus CreditAttribution: Exploratus commentedYour right, I tried it with 2.3. I didnt realize the version just changed, I used to have 2.2. Is there a port to 2.3?
Comment #6
GiorgosKthe patch still applies without change
if you can't make it apply, apply it by hand
after line 661 uc_product.module paste
and test
Comment #7
TR CreditAttribution: TR commentedYour patch has the same problem with database integrity that I mentioned in http://drupal.org/node/737790#comment-3345606 in response to a similar issue. You're fixing one thing at the expense of breaking other things. IMO the only proper way to handle this is to modify Ubercart so SKUs are not only unique but immutable.
Comment #8
casey_2000 CreditAttribution: casey_2000 commentedSorry for my English, I'm from Russia.
I had the problem:
Changing SKU in some product makes Stock create new record with new SKU and it doesn't delete the old one.
The patch published by GiorgosK helped me a lot. It updates SKU in stock when changing in product.
Big thanks.
Comment #9
GiorgosKPlease keep the title to something descriptive of the problem
Comment #10
TimelessDomain CreditAttribution: TimelessDomain commentedduplicatecomplimentary issue #1011068: Changing SKU on a node to a previously used SKU on a different node leads to bogus stock information (wrong reports)Comment #11
hanoiiI don't think #1011068: Changing SKU on a node to a previously used SKU on a different node leads to bogus stock information (wrong reports) it's a duplicate, but rather a complementary issue, they address different things and the patch here won't fix what I have mentioned on that issue.
Comment #12
jlporter CreditAttribution: jlporter commentedputtin my sub skates on
Comment #13
mirocow CreditAttribution: mirocow commentedsubscribe
Comment #14
GiorgosKI know this is not going to be included in ubercart
but just for the people that want a quick fix I updated the patch for 2.4
Comment #15
ratinakage CreditAttribution: ratinakage commentedAnyone know why this patch got ignored?
Comment #16
GiorgosKbecause its just a quick work around which might work in your use case
but its not something that would be of general use
make thorough testing before putting in your live site
Comment #17
longwaveDuplicate of #1398448: stock sku consistency on node update/delete