Problem/Motivation

When deleting tax type, its children (tax rates) will get orphaned.

Same thing with tax rates. When tax rate gets deleted, its children (tax rate amounts) will get orphaned.

Proposed resolution

On \Drupal\commerce_tax\Entity\TaxType::postDelete() and \Drupal\commerce_tax\Entity\TaxRate::postDelete() call its children and delete them.

Comments

iMiksu created an issue. See original summary.

iMiksu’s picture

Assigned: iMiksu » Unassigned
Status: Active » Needs review
bojanz’s picture

Status: Needs review » Fixed

Merged, thanks!

  • iMiksu committed 7261056 on 8.x-2.x
    Issue #2575485 by iMiksu: When deleting tax types or tax rates, delete...
  • bojanz committed a6317ad on 8.x-2.x
    Merge pull request #254 from mikaelkundert/issue/2575485-tax-deletion...
  • iMiksu committed e053c14 on 8.x-2.x
    Issue #2575485 by iMiksu, bojanz: Simplified variable names and deletion...

Status: Fixed » Closed (fixed)

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