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
shaolinsteyr1
View Replies:
JohntheFish replied on at Permalink Reply
JohntheFish
At a guess, the modal and/or stack could be failing to pull in all the relevant assets when cached. Do you get similar problems with the modal & stack for other blocks that use a lot of javascript assets, such as image galleries and Google Maps?

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.
shaolinsteyr1 replied on at Permalink Reply
shaolinsteyr1
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
JohntheFish replied on at Permalink Reply
JohntheFish
I have looked at the page with block cache off. Please enable the cache and I will investigate.
shaolinsteyr1 replied on at Permalink Reply
shaolinsteyr1
is enabled
JohntheFish replied on at Permalink Reply
JohntheFish
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)
<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.
JohntheFish replied on at Permalink Reply
JohntheFish
shaolinsteyr1 replied on at Permalink Reply
shaolinsteyr1
thank you very much, i'm going to follow your suggestion with the html block.
shaolinsteyr replied on at Permalink Reply
shaolinsteyr
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.
JohntheFish replied on at Permalink Reply
JohntheFish
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.
JohntheFish replied on at Permalink Reply
JohntheFish
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.
shaolinsteyr replied on at Permalink Reply 4 Attachments
shaolinsteyr
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.
JohntheFish replied on at Permalink Reply
JohntheFish
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"
JohntheFish replied on at Permalink Reply
JohntheFish
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.
JohntheFish replied on at Permalink Reply
JohntheFish
I have changed the status of this thread to invalid, as it is not actually an MT issue.
shaolinsteyr replied on at Permalink Reply
shaolinsteyr
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.

concrete5 Environment Information

# concrete5 Version
Core Version - 8.2.1
Version Installed - 8.2.1
Database Version - 20170802000000

# concrete5 Packages
Fundamental (4.0.4), Magic Tabs (7.1.2), Pagelist Gallery (1.1.5), toesslab - Week Calendar (1.1.2), Touch Gallery (2.3.2)

# concrete5 Overrides
blocks/page_list/templates/masonry/view.php, blocks/page_list/templates/masonry/view.js, blocks/page_list/templates/masonry/view.css, blocks/page_list/templates/masonry, blocks/page_list/templates/simple_thumbnail_list/view.php, blocks/page_list/templates/simple_thumbnail_list/view.css, blocks/page_list/templates/simple_thumbnail_list, blocks/page_list/templates, blocks/page_list, blocks/touch_gallery/view.php, blocks/touch_gallery/templates/polaroid/view.php, blocks/touch_gallery/templates/polaroid/css/polaroid-styles.css, blocks/touch_gallery/templates/polaroid/css, blocks/touch_gallery/templates/polaroid, blocks/touch_gallery/templates/tight_grid/view.php, blocks/touch_gallery/templates/tight_grid/css/tight-grid-styles.css, blocks/touch_gallery/templates/tight_grid/css, blocks/touch_gallery/templates/tight_grid, blocks/touch_gallery/templates/corner_shadow/view.php, blocks/touch_gallery/templates/corner_shadow/css/corner-shadow-styles.css, blocks/touch_gallery/templates/corner_shadow/css, blocks/touch_gallery/templates/corner_shadow, blocks/touch_gallery/templates/sleek/view.php, blocks/touch_gallery/templates/sleek/css/sleek-styles.css, blocks/touch_gallery/templates/sleek/css/images/magnifier.png, blocks/touch_gallery/templates/sleek/css/images, blocks/touch_gallery/templates/sleek/css, blocks/touch_gallery/templates/sleek, blocks/touch_gallery/templates/focus/view.php, blocks/touch_gallery/templates/focus/css/focus-styles.css, blocks/touch_gallery/templates/focus/css, blocks/touch_gallery/templates/focus, blocks/touch_gallery/templates/circled_tech/view.php, blocks/touch_gallery/templates/circled_tech/css/circled-tech-styles.css, blocks/touch_gallery/templates/circled_tech/css, blocks/touch_gallery/templates/circled_tech, blocks/touch_gallery/templates/morph/view.php, blocks/touch_gallery/templates/morph/css/morph-styles.css, blocks/touch_gallery/templates/morph/css, blocks/touch_gallery/templates/morph, blocks/touch_gallery/templates/random_tilt/view.php, blocks/touch_gallery/templates/random_tilt/css/random-tilt-styles.css, blocks/touch_gallery/templates/random_tilt/css, blocks/touch_gallery/templates/random_tilt, blocks/touch_gallery/templates/tilt/view.php, blocks/touch_gallery/templates/tilt/css/tilt-styles.css, blocks/touch_gallery/templates/tilt/css, blocks/touch_gallery/templates/tilt, blocks/touch_gallery/templates/artist_grid/js/gridify.min.js, blocks/touch_gallery/templates/artist_grid/js, blocks/touch_gallery/templates/artist_grid/view.php, blocks/touch_gallery/templates/artist_grid/css/artist-grid-styles.css, blocks/touch_gallery/templates/artist_grid/css, blocks/touch_gallery/templates/artist_grid, blocks/touch_gallery/templates/circled/view.php, blocks/touch_gallery/templates/circled/css/circled-styles.css, blocks/touch_gallery/templates/circled/css, blocks/touch_gallery/templates/circled, blocks/touch_gallery/templates/simple_shadow/view.php, blocks/touch_gallery/templates/simple_shadow/css/simple-shadow-styles.css, blocks/touch_gallery/templates/simple_shadow/css, blocks/touch_gallery/templates/simple_shadow, blocks/touch_gallery/templates, blocks/touch_gallery, blocks/core_stack_display/templates/toesslab_accordion.php, blocks/core_stack_display/templates, blocks/core_stack_display, blocks/feature/view.php, blocks/feature/templates/hover_description/view.php, blocks/feature/templates/hover_description/view.js, blocks/feature/templates/hover_description/view.css, blocks/feature/templates/hover_description, blocks/feature/templates, blocks/feature/view.css, blocks/feature, blocks/testimonial/view.css, blocks/testimonial, blocks/jl_magic_tabs/templates/self_contained_starter/view.php, blocks/jl_magic_tabs/templates/self_contained_starter/view.css, blocks/jl_magic_tabs/templates/self_contained_starter, blocks/jl_magic_tabs/templates, blocks/jl_magic_tabs, blocks/fundamental_slick_slider/css/slick.css, blocks/fundamental_slick_slider/css, blocks/fundamental_slick_slider, blocks/next_previous/add.php, blocks/next_previous/db.xml, blocks/next_previous/view.php, blocks/next_previous/edit.php, blocks/next_previous/form_setup_html.php, blocks/next_previous/icon.png, blocks/next_previous/controller.php, blocks/next_previous, blocks/ds_pagelist_gallery/templates/no_buttons/js/jquery.spin.js, blocks/ds_pagelist_gallery/templates/no_buttons/js/blazy.min.js, blocks/ds_pagelist_gallery/templates/no_buttons/js/isotope.pkgd.min.js, blocks/ds_pagelist_gallery/templates/no_buttons/js/imagesloaded.pkgd.min.js, blocks/ds_pagelist_gallery/templates/no_buttons/js, blocks/ds_pagelist_gallery/templates/no_buttons/view.php, blocks/ds_pagelist_gallery/templates/no_buttons/view.css, blocks/ds_pagelist_gallery/templates/no_buttons, blocks/ds_pagelist_gallery/templates, blocks/ds_pagelist_gallery, elements/footer-custom.php, css/touch-gallery.css, css/images/sprites.png, css/images/194.png, css/images/preloader.gif, css/images/sprites.svg, css/images, css/foundation.custom.min.css, css/accordion.less, js/toesslab.js, page_templates/blog_entry.php, page_templates/blank.php, src/Helper/SmXmlToArray.php, src/Helper/OptionsGenerator.php, src/Helper/ThemeObject.php, src/Helper/MclInstaller.php, src/Helper/SupermintTheme.php, src/Helper/Upgrade.php, src/Helper/SmArrayToXml.php, src/Helper/BaseOptionsGenerator.php, src/Helper/ThemeFile.php, src/Helper

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - On
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
7.0.22

# PHP Extensions
bcmath, calendar, cgi-fcgi, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, intl, json, libxml, mbstring, mcrypt, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, session, SimpleXML, soap, sockets, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib

# PHP Settings
max_execution_time - 300
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 10000
memory_limit - 320M
post_max_size - 200M
sql.safe_mode - Off
upload_max_filesize - 200M
mysqli.max_links - Unlimited
mysqli.max_persistent - 0
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5

Browser User-Agent String

Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.