-
Notifications
You must be signed in to change notification settings - Fork 619
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
[4.x]: {% js %} and {% css %} tags are ignored inside any {% cache %} tags with pending image transforms #11602
Comments
My guess is it's to do with the ordering of cms/src/services/TemplateCaches.php Lines 136 to 149 in 1cb2edf
I don't know what the implications would be, but would moving the |
Is there a chance this occurs in Craft 3 too? I've been having a problem for sometime that would be explained by this. |
I think a temporary workaround is to add this to config/general.php:
https://craftcms.com/docs/3.x/config/config-settings.html#generatetransformsbeforepageload This isn't really ideal though, as pages with lots of transforms can take an age to load on first view... |
Thanks for reporting! Just fixed for the next Craft 3 and 4 releases. You can get the fix early by changing your |
Thanks so much for the speedy fix @brandonkelly! I can’t yet see it in the changelog on the develop branch – is it definitely fixed for 4.x as well as 3? |
@realjoshharrison I generally haven’t been copying Craft 3.x changes’ release notes over to the Craft 4 changelog, but I should have. Just fixed that (18dda57). |
Craft 3.7.49 and 4.2.0 are out with this fix 🎉 |
What happened?
Description
Any
{% js %}
and{% css %}
tags used inside a{% cache %}
tag are not registered if the cache tag also contains pending image transforms.Reproduced on a clean Craft 4 install with no plugins.
Steps to reproduce
Expected behavior
All CSS and JS inside the
{% cache %}
tag is registered, regardless of image transform status.Actual behavior
All CSS and JS registered inside the
{% cache %}
tag gets ignored until the image transforms finish generating.Craft CMS version
4.1.4.1
PHP version
8.0.8
Operating system and version
MAMP Pro, Darwin 21.5.0, Apache 2.4.48 (MacOS 12.4)
Database type and version
MySQL 5.7.34
Image driver and version
ImageMagick 6.9.6-2
Installed plugins and versions
None
The text was updated successfully, but these errors were encountered: