Preserve the order of bard and replicator sets - #604
Merged
ryanmitchell merged 5 commits intoAug 11, 2026
Conversation
Contributor
|
I've applied it to fieldsets too for completeness. thanks for your work on this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reordering the sets on a Bard or Replicator field doesn't stick when blueprints are stored with the eloquent driver on MySQL. MySQL sorts the keys of a JSON object when it stores it, so the sets come back out in a different order to the one they went in with.
The blueprint repository already works around this for tabs and sections by keeping a
__counton each of them. This does the same for the set groups and sets nested in a field's config, and strips it back out when the blueprint is read or exported. The import command gets it too, since it writes to the database without going through the repository.Fieldsets have the same problem and aren't covered here, as
FieldsetRepositorydoes no order handling at all and would need its own pass. Happy to follow up with that if you want it.Fixes statamic/cms#15152.