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

[5.x] Fix nested field path prefixes #10313

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

jacksleight
Copy link
Contributor

@jacksleight jacksleight commented Jun 17, 2024

#10280 introduced blink caching of the Fields objects in the replicator fields method. This took set indexes into account but not parent paths, which causes the wrong cached objects to be used when you have nested replicators.

This PR fixes that.

I also found an issue with the way field objects loaded from the repository are re-used. They have their parent index set when fetched, but since the same object is being returned it just updates that each time, resulting in one object with the last index set, rather than one object per index. I'm not sure if this is a result of the new blink caching or some other field caching that was introduced with v5, but cloning the object before setting the index fixes it.

@jacksleight jacksleight changed the title Fix nested field path prefix [5.x] Fix nested field path prefix Jun 17, 2024
@jacksleight jacksleight changed the title [5.x] Fix nested field path prefix [5.x] Fix nested field path prefixes Jun 17, 2024
@jasonvarga jasonvarga merged commit ec60b17 into statamic:5.x Jun 17, 2024
21 checks passed
@jacksleight jacksleight deleted the fix/nested-field-path-prefix branch June 17, 2024 20:12
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.

None yet

2 participants