Description
Preconditions and environment
- Magento version: 2.0+ (affected class is \Magento\Framework\Api\Search\SearchCriteriaBuilder)
Steps to reproduce
- Create ui component listing
- Add some columns (id, name, etc)
- Add a Select column, which gets its options from a class that uses SortOrderBuilder.
- Add another non-select column after
- Apply sort to column before select column
Expected result
Columns before and after Select column should be sorted as intended when sort is applied.
Actual result
Columns before Select column (that uses SortOrderBuilder) don't get sort applied.
Columns after Select column do get sort applied.
Additional information
When using Magento\Framework\Api\SortOrderBuilder
while loading a ui listing component (outside of the base DataProvider), trying to sort some columns might not work, depending on which column is being sorted.
If the column applies its sort order after the SortOrderBuilder is used, the sort will work.
The issue is in the \Magento\Framework\Api\Search\SearchCriteriaBuilder
class.
Column ui components apply their sort order to the DataProvider, which adds it to the SearchCriteriaBuilder.
Because the SortOrder object is not created until the SearchCriteriaBuilder create() method is called, other code can use SortOrderBuilder and create an object from it, resulting in the fields from the Column no longer being present.
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done