Skip to content

Broken Tax Rate Search Filter - SQLSTATE[23000] #21521

Closed
@robyerevan

Description

@robyerevan

Preconditions (*)

  1. Magento 2.2.3

Steps to reproduce (*)

  1. Go to Admin -> Stores -> Taxes -> Tax Rules
  2. Add a tax rule
  3. Search tax rule using both Name and Tax Rate fields
    eg. Name = Alabama & Tax Rate = US-AL

Expected result (*)

  1. Combined search executed and output is displayed to admin
  2. Admin can continue using tax rate search again

Actual result (*)

  1. MySQL error is thrown

Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'code' in where clause is ambiguous, query was: SELECT COUNT(DISTINCT main_table.tax_calculation_rule_id) FROM tax_calculation_rule AS main_table
LEFT JOIN tax_calculation AS tc ON main_table.tax_calculation_rule_id = tc.tax_calculation_rule_id
LEFT JOIN tax_calculation_rate AS rc ON tc.tax_calculation_rate_id = rc.tax_calculation_rate_id WHERE ((code LIKE '%Alabama%')) AND ((rc.code LIKE '%US-AL%'))

  1. In production mode blank area displayed instead of grid, admin can not use tax rate search anymore until session/cookies cleared manually
    tax_rules_page_crush

Metadata

Metadata

Assignees

Labels

Component: AdminComponent: TaxFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions