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

Menu Item Order #3

Closed
awcodes opened this issue Apr 21, 2022 · 9 comments
Closed

Menu Item Order #3

awcodes opened this issue Apr 21, 2022 · 9 comments
Labels
invalid This doesn't seem right

Comments

@awcodes
Copy link

awcodes commented Apr 21, 2022

Not sure if this is an issue just on my machine or not, but when saving a menu it appears that the UUID is causing the JSON column to default sort the menu items in ascending order (for indexing purposes, I believe). This prevents the menu item order from being preserved.

This can be seen by saving a menu then just refreshing the page.

@ryangjchandler ryangjchandler added the invalid This doesn't seem right label Apr 21, 2022
@ryangjchandler
Copy link
Owner

@awcodes I can't seem to reproduce this problem.. can you record a video and also send over your model configuration?

@awcodes
Copy link
Author

awcodes commented Apr 21, 2022

The model is the one in the package, i'm not doing anything with it outside of the package.

menu-order.mov

@ryangjchandler
Copy link
Owner

What database are you using?

@awcodes
Copy link
Author

awcodes commented Apr 21, 2022

MySQL 5.7

Looks like the issue is related to this https://dev.mysql.com/doc/refman/5.7/en/json.html#json-comparison

@awcodes
Copy link
Author

awcodes commented Apr 21, 2022

I have verified that the package is maintaining the correct order before saving, so this is definitely a database issue with JSON columns, and not an issue with the plugin itself.

@awcodes
Copy link
Author

awcodes commented Apr 21, 2022

Works perfectly with a longText column and an array cast, but i'm sure you have a reason for using the JSON column.

I'll go ahead and close this, but maybe a note in the Readme would help others in the future.

Thanks for your feedback and patience.

@awcodes awcodes closed this as completed Apr 21, 2022
@ryangjchandler
Copy link
Owner

Ah, interesting... perhaps I'll move to use a longText then for compatibility reasons...

@ryangjchandler
Copy link
Owner

@awcodes I've just released v0.2.0 with a fix for this (changing column to longText), you'll need to run a migrate to get the changes.

You should also publish the assets again and clear your view cache to get the latest CSS changes from your dark mode PR.

Thanks!

@awcodes
Copy link
Author

awcodes commented Apr 21, 2022

@ryangjchandler Awesome. Thanks again for all you do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants