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] Add failing test for issue caused by PR #9585 #10061

Merged
merged 2 commits into from
May 20, 2024

Conversation

aerni
Copy link
Contributor

@aerni aerni commented May 14, 2024

This PR adds a failing test to illustrate the issue caused by PR #9585. That PR makes it impossible to manipulate a blueprint multiple times during the same request. This is an issue when you are relying on manipulating the blueprint at different stages in an EntryBlueprintFound listener.

Jason said: I don't see any noticeable difference in load times, but this PR is only a handful of lines now so I don't think it hurts. So, maybe it's not a big deal to revert the PR altogether?

Else, we might need to find a way to opt-out of the fields cache. Or maybe this is simply a bug that can be fixed while retaining the caching.

@aerni aerni changed the title Add failing test for issue caused by PR #9585 [5.x] Add failing test for issue caused by PR #9585 May 14, 2024
@JohnathonKoster
Copy link
Contributor

Thanks for the failing test! I'll also poke around with this one this week 👍

@aerni
Copy link
Contributor Author

aerni commented May 14, 2024

Thanks, John. Appreciate! ❤️

@plompd
Copy link

plompd commented May 17, 2024

Would be nice to see this fixed, so I can update to Statamic 5 after @aerni updates his Advanced SEO plugin ;)

@JohnathonKoster
Copy link
Contributor

I've updated this PR to also clear the internal blueprint handle cache when mutating fields/adjusting items about the blueprint itself. This will resolve the issue with making multiple changes not regenerating the fields, but continue to help prevent regenerating fields each time parents/etc. are set

@aerni
Copy link
Contributor Author

aerni commented May 19, 2024

I can confirm that this fixes the issue in my Advanced SEO addon.

Before:
CleanShot 2024-05-19 at 16 04 40@2x

After:
CleanShot 2024-05-19 at 16 05 13@2x

@jasonvarga jasonvarga merged commit abf641a into statamic:5.x May 20, 2024
16 checks passed
@aerni aerni deleted the fix/blueprint-fields-cache branch May 20, 2024 14:36
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

4 participants