jreinke / magento-stock-movements

Magento extension to save products stock movements.
http://www.bubblecode.net/en/2012/02/07/magento-save-product-stock-moves/
79 stars 50 forks source link

Unable to cancel order after a product has been deleted #16

Closed mobweb closed 10 years ago

mobweb commented 10 years ago
  1. Set up a brand new 1.7 CE installation
  2. Created two test products
  3. Submitted an order with both products via the frontend
  4. Deleted one of the test products in the backend
  5. Re-indexed all the indices (just to make sure)
  6. Now when I click on Cancel to cancel the order in the backend, it says: The order has not been cancelled.
  7. In the exception log there is the following error: exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (db-1.bubble_stock_movement, CONSTRAINTFK_STOCK_MOVEMENT_ITEMFOREIGN KEY (item_id) REFERENCEScataloginventory_stock_item(item_id) ON DELETE CASCADE ON UPDATE CASCADE)' in /var/www/share/htdocs/lib/Zend/Db/Statement/Pdo.php:228

So I think what's happening is that the extension is trying to update the stock movement log for a product that doesn't exist anymore. Am I doing something wrong or could this be an issue with the extension?

mobweb commented 10 years ago

Also seem to be unable to edit an order for the same reason, haven't found a fix yet.

jreinke commented 10 years ago

Fixed from e19eeb87abaf1a5caf9b0fd7ec2881f85c7016fb

Thanks for your feedback.

mobweb commented 10 years ago

Works perfectly now, thanks!