-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[Backport][2.2] Admin Grid column ordering/positioning not working when single store mode set On #17512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…single store mode set On * added component status based filtering
|
Hi @pavelshulga. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
|
Looking at the code, this would appear to fix the original problem, but column ordering is still not working for me, even though I have applied this fix. There is obviously something else going on. Will investigate. Column ordering seems to no longer work regardless of whether single store mode is on or not, which suggests there is a new unrelated issue affecting column ordering. |
|
@magento-engcom-team give me test instance |
|
Hi @gwharton. Thank you for your request. I'm working on Magento instance for you |
|
Hi @gwharton, here is your new Magento instance. |
|
Here is a video of column ordering not working on the test instance. |
|
There should not be a dependency on single store mode configuration. Could
you please check whether Magento is saving the column order via AJAX call
after any rearranging action using browser developer tool?
On Sat, 11 Aug 2018 at 7:25 pm, gwharton ***@***.***> wrote:
Here is a video of column ordering not working on the test instance.
https://www.youtube.com/watch?v=d_pH8U9NayE
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#17512 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AdwG18Qahqn98tagg_x3oqIETOyTULDbks5uPqMfgaJpZM4V4-tc>
.
--
"Please excuse any typos"
|
|
@gwharton , thanks for sharing credentials to the instance. I was able to log in and check the functionality and the solution. I used the sales order grid and was able to successfully reorganise columns. After each change, Magento sends AJAX call to save all the changes (URL /admin/mui/bookmark/save/?isAjax=true). |
|
If I move a column, i immediately get an ajax call to save the position. In my case I see the following data in the Ajax call.
If I then just click refresh, the page reloads, and somewhere amongst the loading is another ajax call to save the bookmark positions again.
The order has changed. Please try yourself, log in to the test instance, go to sales order grid, move customer name column one position to the left, so it is customer email, group, name and then subtotal. Then refresh the page and check again. |
|
Thanks for the detailed information regarding your testing. Could you please review the video of my test attempt and advise what should be adjusted as the outcomes seem perfectly fine for me? Possibly the issue with the testing is due to racing between two concurrent AJAX requests during your test run which overwrite changes of each other (case when earlier started request is being process after later one). |
|
Hi there @pavelshulga I've done a bit more debug on my own freshly deployed 2.2.5 test instance with your PR applied. The following happened
Log of ajax calls and database content.txt You can see that during a normal refresh when the column ordering is correct, there is no AJAX call during the page refresh. Once it starts going wrong, an AJAX call is made during the page refresh which is what is incorrectly adjusting the column ordering. I notice in your video, that you also saw an AJAX call during your page refresh, although the resulting column ordering did still appear correct. Perhaps it was moving a column that wasnt visible in your example. Try again with all columns visible and keep watching for AJAX calls made during the page refresh. |
|
@pavelshulga. Im pretty confident there are two independent issues. When this issue was raised column ordering only failed when single store mode was on. This is the first bug and is the one you fixed with this PR. Sometime after raising the issue column ordering also stopped working when single store was set to off. I think this is bug no.2 and is what we are seeing here as you have fixed bug no.1. Bug no.2 appears in all modes and seems related to the extra erroneous ajax call during page load/refresh. |
|
@gwharton Could you please add steps to reproduce the bug 2 (for future reference)? In meantime, I'll work on investigation/resolution. |
|
I'm struggling to get a definitive set of steps to 100% reproduce the bug, apart from "move columns around at random, and it normally occurs within 5 or 6 attempts. I have done some digging though, In file Magento_Ui/js/grid/listing.js initElement() gets called for each column as it is created on page load. Once all columns are loaded a call is made to initPositions() to set the positions. If I run require('uiRegistry').get("sales_order_grid.sales_order_grid.sales_order_columns") just prior to the initPositions call, the order of the columns in the _elems array that is returned is in the default order. If you re-run require('uiRegistry').get("sales_order_grid.sales_order_grid.sales_order_columns") just after the initPositions call, the order of the columns in the _elems array is correct and should match what should be rendered to the screen (usually, aslong as the bug is not occurring) I don't fully understand whats going on in the initPositions call, but it looks like it retrieves the column ordering from the local storage/uiRegistry. For some reason, when this bug is occurring, on a page refresh, if I break execution just after the initPositions call and if I run require('uiRegistry').get("sales_order_grid.sales_order_grid.sales_order_columns") ,the order of the columns in the _elems array is incorrect and is not what was expected. For some reason, the incorrect column ordering is obtained from local storage/uiRegistry. The code knows that the column ordering it has just retrieved is not the same (somehow) and it triggers off the change event which ultimately results in the firing off, of the AJAX call with the wrong ordering in it. Might give some clues as to where to look....... |
|
I did some testing on all versions from 2.2.0 to 2.2.5
It shows that PR #17512 does indeed fix BUG 1, which is the original issue #12070 It also shows that the other bug (BUG 2) happens regardless of single store mode. I am going to create a new issue to track BUG 2, as they are independent issues. This way PR 17512 can go forward as the fix for issue #12070 while the resolution to BUG 2 is worked on. |
|
I have created a new issue to capture the second bug mentioned above (#17691). The testing that I have done on this issue shows that this PR does indeed fix the first bug (#12070) and can therefore proceed accordingly. It can easily be tested as without this fix in single store mode, there are no AJAX calls made from the browser to the backend when you move any columns. With this PR applied, the AJAX calls are made every time and can easily be inspected to contain the correct information. |
|
Manual Testing Scenareo.
|
|
2.3-develop PR is here #18405 |
|
Note, if during testing you see that column positioning is not working properly, you may also be running into issue #17691 which remains unfixed. This PR addresses only the issue of the missing AJAX calls. |
|
Hi @josefbehr, thank you for the review. |
|
Duplicate of #18561 |
As I am using magento 2.2, I am also facing the ajax call issue on sales order grid issue. Just wanted to know,did you get any solution for this issue. If yes, please share with us also. Thanks |
|
Bug 2 still present in 2.4-develop. #23889 |
As I can see, This issue is not present in 2.3.4. |
|
I certainly see it in 2.3.4. I can reproduce with stock 2.3.4. |
added component status based filtering
Description
New functionality filters out all disabled UI components (based on internal logic some components are not applicable when the store has single store mode enabled) as it affects children length comparison and different useful UX behaviours.
Fixed Issues
Manual testing scenarios
Contribution checklist