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

Fix issue of embed tag changing cached templates #475

Merged
merged 3 commits into from
Sep 13, 2019

Conversation

cjbrooks12
Copy link
Contributor

Fix issue of embed tag changing cached templates and breaking includes using the same-named template from the cache.

For example, let's say templateA.peb embeds templateX.peb, while templateB.peb just includes it. If template caching is enabled, both the embed and include tag will use the same cached PebbleTemplateImpl object. But for the embed tag to work, it needed to change some of the data in that template, so that later on, when it's just included later, the modified template is being included.

By making a shallow copy of the cached template, the embed tag can make the changes it needs to without affecting what's already in the cache.

@ebussieres
Copy link
Member

@cjbrooks12 Build is failling

@cjbrooks12
Copy link
Contributor Author

Build's fixed

@ebussieres ebussieres added this to the 3.1.1 milestone Sep 13, 2019
@ebussieres ebussieres merged commit a860905 into PebbleTemplates:master Sep 13, 2019
@cjbrooks12 cjbrooks12 deleted the defects/embed-cache branch October 22, 2019 01:03
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.

2 participants