When I remove my order, commerce_reports_tax table still contains record with this order.

How to reproduce:
-create an order with tax;
-set status of order as pending;
-check what tax record has been added to commerce_reports_tax table;
-remove order;

Expected result:
-record with removed order should be removed from commerce_reports_tax table (because we removed order);

Actual result:
-commerce_reports_tax table still contains record with removed order.

Comments

skdrupal88’s picture

Status: Active » Needs review
StatusFileSize
new646 bytes

We have to implement entity_delete() hook. So if we delete order, such record should be removed from commerce_reports_tax table.
Patch in attachments

mglaman’s picture

I'll test this, my only nitpick would be this: Entity API should expose hook_{ENTITY_TYPE}_delete($entity), and I'd rather use that.

andrewsizz’s picture

Status: Needs review » Reviewed & tested by the community

Oh, important issue. Tested on ERPAL platform and it works!

mglaman’s picture

Status: Reviewed & tested by the community » Fixed

Committed!

  • mglaman committed 5450ffa on 7.x-4.x authored by korgik
    Issue #2380203 by korgik: Tax reports - order delete hook missed
    
skdrupal88’s picture

Great, Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Status: Closed (fixed) » Needs work

The last submitted patch, 1: commerce_reports-order_delete_hook-2380203-1.patch, failed testing.

mglaman’s picture

Status: Needs work » Fixed

Silly test bot.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.