Passer la navigation

[En attente du retour de l'utilisateur] 1.6.28 regression: dynamic toolset-blocks-styling CSS not generated

This support ticket is created Il y a 1 week, 4 days. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Ce sujet contient 7 réponses, a 1 voix.

Dernière mise à jour par - Il y a 1 week.

Assisté par: Christopher Amirian.

Auteur
Publications
#2881818

I am trying to:
Use Toolset Blocks Grid block on a WordPress Archive to display a 4-column artist grid. The dynamic toolset-blocks-styling CSS (grid-template-columns + card backgrounds) is not generated on Toolset Blocks 1.6.28, but works correctly on 1.6.13 with identical site configuration.

Link to a page where the issue can be seen:
lien caché (Toolset Archive ID 21984, View ID 21983)

I expected to see:
The <style id="toolset-blocks-styling"> block in the page head containing the grid-template-columns definitions (4x minmax(0,0.25fr) on desktop, 3 columns on tablet, 2x 0.5fr on phone) and the card background styles (rgba(242,245,247,1)). This worked correctly on Toolset Blocks 1.6.13.

Instead, I got:
On Toolset Blocks 1.6.28, the <style id="toolset-blocks-styling"> block is completely absent from the page head. The .tb-grid collapses to a single column, and the card backgrounds are missing. The block settings are intact (columnsDesktop: [0.25,0.25,0.25,0.25], columnsPhone: [0.5,0.5]) and the markup is structurally correct.

Environment:
- Site: floridahighwaymenpaintings.com
- WordPress: 7.1.2
- Theme: Astra 4.13.12
- Toolset Types: 3.6.3
- Toolset Blocks 1.6.28: BROKEN (no dynamic CSS)
- Toolset Blocks 1.6.13: WORKING (dynamic CSS generated correctly)

Steps to reproduce:
1. Create a WordPress Archive with a Toolset Grid block (4 columns desktop, 2 columns phone).
2. View the archive on the frontend with Toolset Blocks 1.6.28 active.
3. Inspect page head — the <style id="toolset-blocks-styling"> block is missing.
4. Downgrade to Toolset Blocks 1.6.13 — the style block appears and the grid renders correctly.

Additional evidence:
- Performed a clean reinstall of pristine Toolset Blocks 1.6.28 files (downloaded from toolset.com) — the issue reproduced identically, ruling out corrupted files.
- The 1.6.13 changelog specifically mentions "Fix: grid styles for WordPress Archives" (Feb 14, 2024).
- The 1.6.10 changelog mentions "Fix: restore desktop grids rendering 4 columns" and "Fix: restore Views and WordPress Archives grid layouts."

Question: What changed in the CSS generation logic between Toolset Blocks 1.6.13 and 1.6.28 that would cause the dynamic toolset-blocks-styling block to stop being output? How can this be fixed?

#2881821

Christopher Amirian
Supporter

Les langues: Anglais (English )

Hi,

Welcome to Toolset support. I created a clean installation of Toolset. You can login using this link:

lien caché

Would you please create a WordPress archive as you mentioned and see if the same issue happens there?

That will help to report this to the development team.

Thanks.

#2881878

Hi Christopher, reporting back with a root cause.

TL;DR: it's a conflict with WP Rocket's JavaScript optimization, not a pure Toolset regression. On Toolset Blocks 1.6.27 the block CSS is delivered via JavaScript at runtime, and WP Rocket's 'Minify JavaScript files' and 'Load JavaScript deferred' EACH independently break that delivery (I tested every toggle combination). Note: the Toolset-side change was introduced somewhere between 1.6.13 and 1.6.27 — I skipped the versions in between, so I can't pin it to a single release; please don't read this as '1.6.28 introduced it'.

The mechanism, from the 1.6.27 source: per-block responsive CSS (e.g. the Grid block's grid-template-columns media queries) is base64-encoded by PHP into hidden <div class="tces-js-style-encoded"> elements, with an inline <script class="tces-js-move-to-head"> that calls toolsetCommonEs.styleToHead() to decode them into <style id="toolset-blocks-styling"> in <head> (see common-es/server/Block/Style/Loader.php and common-es/public/toolset-common-es-frontend.js). The static style.css isn't enqueued normally either — blocks/server/FrontendAssets.php prints its own lazy-load inline script (IntersectionObserver on [class^='tb-']) that injects the stylesheet on window load + scroll/intersection. When that JS chain breaks, no grid CSS is applied: the artist grid collapses to a single column with no card backgrounds and the style tag never appears.

What I ruled out: the sandbox test confirmed 1.6.27 works on a clean install; deactivating all non-Toolset plugins isolated WP Rocket as the conflicting plugin; 'Delay JavaScript execution' was already disabled and is not a factor; no single CSS option (Minify CSS, Optimize CSS delivery) has any effect. Excluding Toolset's external script files from WP Rocket's minify/defer exclusion lists did NOT help, which points at the inline scripts being mangled rather than the enqueued files.

Current workaround: WP Rocket stays fully active with JS minification ON, using the "Excluded Inline JavaScript" patterns toolsetCommonEs and toolset-blocks; only JS combining and JS deferral remain disabled. Grid renders correctly on Toolset Blocks 1.6.27 with this configuration.

It would be great to get an official compatibility fix — e.g. making the style injection resilient to minification/deferral (the move-to-head script silently no-ops when toolsetCommonEs is undefined at DOMContentLoaded), or documenting the exact WP Rocket exclusion. Happy to test a dev build.

#2882043

Thank you for the details. May I ask you to install WP Rocket and set the JavaScript minification and stuff in a way that will show the error?

lien caché

Most probably, you will need to show it on a page where the CSS is not loading dynamically or something.

That way, I will be able to send this to our second-tier support.

Needless to say, as this is a WP Rocket compatibility issue, it will for sure have a lower priority, and it might need the cache plugin developers' cooperation.

Thanks.

#2882335

Hi Christopher,

I can't install WP Rocket on the sandbox because there is no free version, and I'm not willing to use one of my paid license's site slots on a third-party sandbox.

To reproduce it, use a clean WordPress install with Toolset Blocks 1.6.27 and a WordPress Archive containing a Toolset Grid block, for example 4 columns on desktop and 2 on phone. In WP Rocket > File Optimization, enable "Minify JavaScript files," while leaving "Load JavaScript deferred" and "Combine JavaScript files" off. Deferral also breaks it independently.

The minifier mangles Toolset's runtime CSS-injection inline scripts: the <script class="tces-js-move-to-head"> call to toolsetCommonEs.styleToHead() that decodes the base64 block CSS into <style id="toolset-blocks-styling">, plus Toolset's lazy-load inline script for style.css. The style tag then never appears, and the grid collapses to one column with no card backgrounds.

#2882975

Hi,

I installed WP Rocket on the sample website. May I ask you to check now and see if you can replicate the issue you described?

lien caché

Thanks.

#2882999

Hi Christopher, I've narrowed this down. The issue does not reproduce on the sandbox because the sandbox is not running the same code as the 1.6.27 release on my site. The sandbox's "Toolset Blocks 1.6.27" is the Views codebase (main file wp-views.php) and ships no common-es library — so it prints <style id="toolset-blocks-styling"> server-side into <head> and never uses the runtime path. The genuine 1.6.27 release (downloaded from my Toolset account) ships common-es and delivers the grid CSS at runtime: base64-encoded <div class="tces-js-style-encoded"> elements plus <script class="tces-js-move-to-head"> calling toolsetCommonEs.styleToHead(). That runtime injection is exactly what WP Rocket 3.23.3.3's "Minify JavaScript files" breaks — with minify on (combine/defer/delay off, no exclusions), the style tag never appears and the grid collapses to a single column. Excluding toolsetCommonEs and toolset-blocks under "Excluded Inline JavaScript" keeps minification working with the grid intact on my site.

So the sandbox as provisioned cannot reproduce this issue — the code path involved doesn't exist in its build. For reference: with WP Rocket active on the sandbox, the test archive renders correctly at 4 columns whether JS minification is on or off; I've left the sandbox with JS minification off.

#2883118

Hi,

Thank you. I made sure the Sandbox bow uses 1.6.28 and it is the exact version that is available in the downloads.

Is it possible that you can check now and tell me how to replicate the issue?