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(web/twig): ems_template_exists use template builder #1062

Merged
merged 5 commits into from
Dec 16, 2024

Conversation

theus77
Copy link
Member

@theus77 theus77 commented Nov 3, 2024

Q A
Bug fix? y
New feature? y
BC breaks? n
Deprecations? n
Fixed tickets? n
Documentation? n

Load templates even if asset_hash.twig is missing

@theus77 theus77 marked this pull request as ready for review November 3, 2024 13:38
@theus77 theus77 requested a review from a team as a code owner November 3, 2024 13:38
{
$settings = $this->settings($environment);

return null !== $environment->getLocal()->getTemplates($settings)->find($templateName->getSearchName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getLocal(), will throw an Exception if you are not in dev mode.

You should check with $environment->isLocalPulled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if it's not pulled, we'll need to do elasticsearch query? How to know if a template exist or not?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@theus77 theus77 marked this pull request as draft November 9, 2024 07:43
@theus77 theus77 marked this pull request as ready for review December 15, 2024 10:34
@theus77 theus77 requested a review from Davidmattei December 15, 2024 10:35
@Davidmattei Davidmattei changed the title fix: missing hash fix(web/twig): ems_template_exists use template builder Dec 16, 2024
{
$settings = $this->settings($environment);

return null !== $environment->getLocal()->getTemplates($settings)->find($templateName->getSearchName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct

@Davidmattei Davidmattei added this to the 5.25.0 milestone Dec 16, 2024
@Davidmattei Davidmattei merged commit 77f1305 into 5.x Dec 16, 2024
3 checks passed
@Davidmattei Davidmattei deleted the fix/missing-hash branch December 16, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants