Closed sethobey closed 1 year ago
Should we also remove any unnecessary code from AddTjSyncDateToGrid.php. Specifically are the addFilterToMap method calls still necessary?
@dallendalton Good call out!
In consideration of your comment I refactored the AddTjSyncDateToGrid::class
to remove duplicated code, then wrote some integration tests to validate the joins. In the process, I identified another potential ambiguous query (order_id
) when filtering the sales-order-creditmemo grid which is also now addressed in BeforeApplyFilters::class
plugin.
While I was at it, I updated our sales-related ui_component
XML overrides to use Magento's default date column types, allowing us to remove 3 (unnecessary) custom UI component column definitions. This also now enables filtering on TJ sync date values.
Context
Closes #341
Customer identified regression in sales order grid when filtering by date. Magento core code does not prefix
created_at
filter value with table alias leading to ambiguous query.Description
main_table
alias when filtering Order or Creditmemo grids bycreated_at
values and OrderCreditmemo gridorder_id
Performance
Adds overhead of additional type-checking operation when querying for any UI collections, but should still only introduce negligible latency.
Testing
Order grid
created_at
) and/or Synced To TaxJar (tj_salestax_sync_date
)Creditmemo grid
created_at
) and/or Synced To TaxJar (tj_salestax_sync_date
)Sales Order Creditmemo grid
created_at
) and/or Synced To TaxJar (tj_salestax_sync_date
)Versions