magento2: Sales Order Grid column ordering not saved properly
Preconditions (*)
- magento 2.3-develop vanilla
Steps to reproduce (*)
- deploy 2.3-develop
Sales -> Orders
Enable all columns
Open Browser Development Tools
Filter network requests for the url string "?isAjax=true"
Make a note of column orders
Move a column and note new position
Verify that there is an "?isAjax=true" call made to the server after column move
Refresh Page
Verify column ordering on page after refresh
Note whether an "?isAjax=true" call is made during page reload
Repeat Refreshing Page noting column ordering and presence of "?isAjax=true" call
Expected result (*)
- Column ordering is maintained across page refreshes
- “?isAjax=true” calls should only be made immediately after column move, not page refresh
Actual result (*)
- Seemingly randomly chosen columns move on successive page refreshes (not every refresh).
- “?isAjax=true” calls are made back to the server during page refresh (not every refresh) with incorrect column order
- The ajax call incorrectly changes column ordering stored on the server. The page then renders the wrong order in accordance with what is set on the server.
Old Issue
magento/magento2 #17691 - Admin Grid column ordering/positioning not working
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 20 (12 by maintainers)
I just deployed this version of 2.4.2-p1 as a test. It doesnt do it every time you move a column, but when it does do it, it is consistent. See the above video. I first move the Braintree Transaction Source column and then refresh. That one works fine. I then move the Allocated Sources column next to the Braintree Transaction Source column and then refresh. That one fails and is positioned one space to the right after refresh. Notice that there is an extra isAjax=true call on page refresh, indicating it has adjusted the column ordering in error.
I traced it to a bug in the collection.js code when it reorders columns. See above notes.