Skip to content
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

M2.2.0 Admin Grid column ordering/positioning not working when single store mode set On #12070

Closed
gwharton opened this issue Nov 7, 2017 · 11 comments
Assignees
Labels
Event: balance-cd Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@gwharton
Copy link
Contributor

gwharton commented Nov 7, 2017

Preconditions

  1. Magento 2.2.0, no special setup
  2. Installed as defaults, just one store/website.

Steps to reproduce

  1. Set single store mode to no.
  2. Clear Cache
  3. TRUNCATE ui_bookmark table
  4. Go to sales order grid
  5. Move Status column close to start of table
  6. Refresh Sales order grid
  7. Sales order grid should be presented with the same column ordering with Status column close to start of table
  8. Confirm in MYSQL ui_bookmark table that the "current" bookmark for sales order grid contains "positions" data
  9. Change single store mode to yes
  10. Clear Cache
  11. TRUNCATE ui_bookmark table
  12. Go to sales order grid
  13. Move Status column close to start of table
  14. Refresh Sales order grid
  15. Sales order grid does not remember column ordering
  16. Confirm in MYSQL ui_bookmark table that the "current" bookmark for sales order grid does not contain "positions" data

INITIAL FINDINGS

When Magento creates an admin grid, it calls

Magento_Ui/js/grid/listing.js::initElement($item)

for each column in the grid.

This function calculates totalCount to be the total number of columns available to be added and currentCount to be the current number of columns added. currentCount increases as each column is added, until currentCount==totalCount at which point it triggers the call to enable and apply positioning data for the columns, as as far as it knows, all columns have now been added.

When single store mode is set to yes the "Purchase Point" column is hidden and cannot be selected, however the value of totalCount in the above function still includes the Purchase Point column. When the columns are added to the grid, the purchase point column is skipped and we reach the situation that we never get to the point of currentCount==totalCount and the positioning calls are never called. We always fall 1 column short of triggering the positioning calls.

Effectively we have

Single Store mode = yes
Visible columns = 19
totalCount = 20
Columns added to grid = 19
Positioning is not triggered as currentCount never reaches totalCount

Single Store mode = no
Visible columns = 20
totalCount = 20
Columns added to grid = 20
Positioning is triggered

@magento-engcom-team magento-engcom-team added Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Nov 7, 2017
@magento-engcom-team
Copy link
Contributor

@gwharton, thank you for your report.
We've created internal ticket(s) MAGETWO-83353 to track progress on the issue.

@xmav
Copy link
Contributor

xmav commented Jan 10, 2018

Same for products grid.
(Websites column is not visible with Single Store mode = Yes)

@VirtusB
Copy link

VirtusB commented May 7, 2018

This issue still persists

@VirtusB
Copy link

VirtusB commented Jun 7, 2018

@gwharton Have you figured out a temporary fix?

@gwharton
Copy link
Contributor Author

gwharton commented Jun 7, 2018

Nope, and it is annoying the heck out of me at the moment. Seems that column positioning doesnt work regardless of whether single store mode is on or off now. This seems a recent change in the latest version.

@pavelshulgabi
Copy link

I'm working on #cd-balance

@magento-engcom-team
Copy link
Contributor

@pavelshulga thank you for joining. Please accept team invitation here and self-assign the issue.

@pavelshulgabi
Copy link

PR created

@gwharton
Copy link
Contributor Author

gwharton commented Oct 5, 2018

Note, this issue is fixed by PR's #17512 (2.2) and PR #18405 (2.3)

There is another issue related to column positioning which is #17691 which is still unresolved.

@sidolov
Copy link
Contributor

sidolov commented Oct 12, 2018

Hi @gwharton. Thank you for your report.
The issue has been fixed in #18405 by @gwharton in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.1 release.

@sidolov sidolov added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Oct 12, 2018
@magento-engcom-team
Copy link
Contributor

Hi @gwharton. Thank you for your report.
The issue has been fixed in #18561 by @gelanivishal in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.8 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Event: balance-cd Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

7 participants