block cache prevents tabs
Permalink Browser Info Environment
i have magig tabs within a stack that opens with a modal from the fundamental theme. if i tur n block cache on, it shows the stack without tabs.
Type: | Pre-Sale |
---|---|
Status: | Archived |
thanks for the quick reply. i had not the time to test it with other java blocks. i can do it tomorrow evening, but you can have a look at the site with disabled block and full site caching:http://www.shaolinsteyr.at
it is the button "Fragen" at the homepage. I can change the cache settings tomorrow evening (possibly tomorrow morning)
thanks
it is the button "Fragen" at the homepage. I can change the cache settings tomorrow evening (possibly tomorrow morning)
thanks
I have looked at the page with block cache off. Please enable the cache and I will investigate.
is enabled
I have identified the problem, its as I first suspected, the modal is not pulling in assets required by blocks in the stack. this is most obvious inhttps://www.shaolinsteyr.at/packages/jl_magic_tabs/js/jl_magic_slice... , but will also show up in other degraded behaviour in transitions, tab history, tab memory etc. and similar in other blocks that declare and require assets through the core asset management system.
You can get round the current problem by adding an HTML block with a script element in it to the bottom of the page, so manually patching up the problem with the modal block. You should do that using my Safe HTML block template (free in the marketplace)
An alternate way of doing the same would be with an extra content attribute or coding the script element into a page template. Using an HTML block is probably the simplest.
As I noted, until the modal block is fixed to check resource requirements from within the stack, you could get further problems with some other aspects of magic tabs or anything else you put into modal blocks. However, once you know what scripts (or css) it is failing to load, you can apply similar patches using an HTML block.
You can get round the current problem by adding an HTML block with a script element in it to the bottom of the page, so manually patching up the problem with the modal block. You should do that using my Safe HTML block template (free in the marketplace)
<script src="https://www.shaolinsteyr.at/packages/jl_magic_tabs/js/jl_magic_slice.min.js"></script>
An alternate way of doing the same would be with an extra content attribute or coding the script element into a page template. Using an HTML block is probably the simplest.
As I noted, until the modal block is fixed to check resource requirements from within the stack, you could get further problems with some other aspects of magic tabs or anything else you put into modal blocks. However, once you know what scripts (or css) it is failing to load, you can apply similar patches using an HTML block.
thank you very much, i'm going to follow your suggestion with the html block.
i think i have a general problem with loading assets on my site. loading the script manually is working so far, but it isn't loading the css as well. This problem occours on different blocks on different pages, also concrete standard blocks (testimonial).
The really strange thing is: Everything is working after clearing cache. But it is random how long it is working. For each page and block different. Could be minutes or days. And the same behavior occurs if caching is completely off.
The really strange thing is: Everything is working after clearing cache. But it is random how long it is working. For each page and block different. Could be minutes or days. And the same behavior occurs if caching is completely off.
Are you on the latest version of Fundamental?
Have you set any enforced cache overrides, either at block or page level?
You could look at the theme header.php and footer.php etc. elements and check it is building all the right c5 core parts (compare the files to elemental).
To patch it up, you could add direct <link> elements with URLs for the missing css files using the Header Extra Content attribute.
Specific to MT, there are naming conventions for tab templates to ensure MT pulls in the correct additional css assets. That shouldn't affect self_contained_starter as it only needs its own view.css, but if you are using any other tab templates they could need this.
Have you set any enforced cache overrides, either at block or page level?
You could look at the theme header.php and footer.php etc. elements and check it is building all the right c5 core parts (compare the files to elemental).
To patch it up, you could add direct <link> elements with URLs for the missing css files using the Header Extra Content attribute.
Specific to MT, there are naming conventions for tab templates to ensure MT pulls in the correct additional css assets. That shouldn't affect self_contained_starter as it only needs its own view.css, but if you are using any other tab templates they could need this.
There could be some core issues related
https://github.com/concrete5/concrete5/issues/3970...
https://github.com/concrete5/concrete5/issues/7362...
Though the second issue also ends with a reminder to approve the stack and page.
https://github.com/concrete5/concrete5/issues/3970...
https://github.com/concrete5/concrete5/issues/7362...
Though the second issue also ends with a reminder to approve the stack and page.
i had to do with other stuff, but now i investigated this thing further.
i have 3 blocks with this issue (magic-tabs is patched with your advice):
image-slider
testimonial
toesslab-calendar
i investigated the image-slider as example:
steps to reproduce:
1. clear cache
2. open site (everything works fine) see attached images
3. refresh (sometimes it stops working after first refresh, sometimes it works a day, quite wired)
i compared with the network analysis tool of firefox. if it is working somme css assets are bigger than when it is not working and all js assets are size 0 if it is not working. you can see it in the attached images.
i know this is probably not the right place for putting this problem, but i would appreciate it if you can help me or lead me to an appropriate place.
i have 3 blocks with this issue (magic-tabs is patched with your advice):
image-slider
testimonial
toesslab-calendar
i investigated the image-slider as example:
steps to reproduce:
1. clear cache
2. open site (everything works fine) see attached images
3. refresh (sometimes it stops working after first refresh, sometimes it works a day, quite wired)
i compared with the network analysis tool of firefox. if it is working somme css assets are bigger than when it is not working and all js assets are size 0 if it is not working. you can see it in the attached images.
i know this is probably not the right place for putting this problem, but i would appreciate it if you can help me or lead me to an appropriate place.
The css with the long cryptic name is c5 combining and minifying various css files required by the page. In the second pair of traces, similar appears to be happening with the combined and minified .js. As you note, on the 'failed' pages this is significantly smaller.
I expect your site environment has moved on a bit since this thread started. However, my guess is that the problem is affecting all addon block css/js files.
How this would manifest on the page: Missing js prevents functionality from working. If the js was loaded, but the css still missing, it would result in it sort of working but looking wrong.
My first suspicion would be the theme, but Fundamental is a mature and robust theme that is widely used, so I would expect the problem to have been previously reported if it were theme related.
There were some GitHub issues reported with the css and js caching on older cores, but these appear to have all been resolved before v8
This may not be c5. It could be an external cache or similar implemented by your host setup.
The best general workaround I can suggest is to disable the 'combine' option in the c5 cache settings and see if that is more stable.
There was a core bug early in v8 that prevented edit mode from being accurately detected. Perhaps that also affects script minification. For example, a block controller tests for edit mode and only loads the tabs scripts outside of edit mode. So if the cache was regenerated by mistake while a page was in edit mode, the cache may not be built with the relevant assets.
That core bug has been fixed, so you could also try upgrading to v8.4.5. But please take a database and files backup first, core upgrades have been known to fail and require reverting to a backup.
If, after upgrading to the latest c5 core you still have the problem, that would need to be reported on GitHub. A title along the lines of "Package script and css assets randomly omitted from combined/minified cache files"
I expect your site environment has moved on a bit since this thread started. However, my guess is that the problem is affecting all addon block css/js files.
How this would manifest on the page: Missing js prevents functionality from working. If the js was loaded, but the css still missing, it would result in it sort of working but looking wrong.
My first suspicion would be the theme, but Fundamental is a mature and robust theme that is widely used, so I would expect the problem to have been previously reported if it were theme related.
There were some GitHub issues reported with the css and js caching on older cores, but these appear to have all been resolved before v8
This may not be c5. It could be an external cache or similar implemented by your host setup.
The best general workaround I can suggest is to disable the 'combine' option in the c5 cache settings and see if that is more stable.
There was a core bug early in v8 that prevented edit mode from being accurately detected. Perhaps that also affects script minification. For example, a block controller tests for edit mode and only loads the tabs scripts outside of edit mode. So if the cache was regenerated by mistake while a page was in edit mode, the cache may not be built with the relevant assets.
That core bug has been fixed, so you could also try upgrading to v8.4.5. But please take a database and files backup first, core upgrades have been known to fail and require reverting to a backup.
If, after upgrading to the latest c5 core you still have the problem, that would need to be reported on GitHub. A title along the lines of "Package script and css assets randomly omitted from combined/minified cache files"
As an aside, I have been working on an update of MT. Amongst other things, the split of JS and CSS asset files has changed. To accommodate that change you would need to adapt the files loaded in the workaround.
I have changed the status of this thread to invalid, as it is not actually an MT issue.
first: thanks for you help. i appreciate this very much
second: update: after updating c5 to 8.4.5 i played around with the cache settings again, and now everything seems to work without workaround when only block-cache is disabled. that helped not in previous versions.
so now this is kinda solved for me.
second: update: after updating c5 to 8.4.5 i played around with the cache settings again, and now everything seems to work without workaround when only block-cache is disabled. that helped not in previous versions.
so now this is kinda solved for me.
Can you direct me to a page with the modal, stack and tabs on it? If you can show me a page with the block cache off, so I can have a look and see it working fully, then I will post again and you can switch on the block cache so I can see it failing. With that information, I may be able to suggest a workaround.