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

Ordering issues with associative array #105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Voltra
Copy link

@Voltra Voltra commented Dec 19, 2023

Fix ordering issues by using regular arrays instead of associative arrays. Existing code should work as is, thanks to PHP handling both kinds of arrays the same way.

This is a proposition of fix that highlights a problem: There's an issue with sorting.

Sorting is always correct when done in the create/edit view. But once saved and reloaded, the items were sorted by UUID (i.e. by array keys) instead of keeping their manually attributed order.

@Voltra
Copy link
Author

Voltra commented Jan 3, 2024

My guess is that since JSON objects are unordered sets of name/value pairs, there's no guarantee it'll keep ordering across systems (e.g. PHP-level serde, DB-level serde)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant