Closed svondervoort closed 1 month ago
Please update to the latest version of the plugin, currently 4.16.3 (for Craft 4). If the issue persists then please refresh the entire cache, to ensure that Blitz is tracking elements correctly, before retesting.
Sorry, I copied the version from composer.json instead of the composer.lock. The version in use is 4.16.3
.
Can you provide the exact minimal steps to reproduce the issue, so I can test locally?
Hi Ben, sorry for the late reply. I finally had some time creating and testing a minimum setup with the following versions:
4.9.2
4.18.0
Plain Text
field within. blitz_caches
table the expireDate
for the entry is still null
.Title
of the entry and save the entry.blitz_caches
table the expireDate
for the entry is updated.Please let me know if you need more input.
Before step 5, you should visit the page that outputs the entry with the matrix field, so that Blitz is aware of it. You’ll then be able to see whether the page is tracked in the diagnostics utility. Please try that and let me know if it makes any difference. Testing this locally works as expected.
I'm sorry I must be doing something wrong.
Just to be sure I've setup a totally new blank Craft v4.9.2
project and only installed Blitz with a basic setup.
General Settings - Refresh mode: Clear the cache, regenerate manually or organically
General Settings - Included URI Patterns: .*
Cache Storage - Folder Path: @webroot/cache/blitz
Cache Generation - Cache Generator: Local Generator
After visiting he page I do see the page in the diagnostics utility but now even when I simply edit the title or add/remove a matrix block the expiry date
is never set.
Since you have the refresh mode set to Clear the cache...
, the page will be cleared on refresh, meaning that there’s no reason to set the expiry date. And expiry date is only ever set if the refresh mode is set to Expire the cache...
.
Ah yes. I changed the refresh mode to Expire the cache...
and now it at least sets an expire date
when I edit the title of the page, but still not when I edit or add a Matrix block to the same Entry.
Can I provide you with the test project or something?
Yes, you can send access details or a full project to support@putyourlightson.com, along with instructions on how to replicate, and I'll take a look.
Thanks for taking the time, email send.
Tested, and the issue is that the matrix field is not output in the cached page, therefore Blitz is not tracking it. Adding the following Twig code to your template will result in the behaviour you expect.
{% for block in entry.matrix.all() %}
<p>{{ block.blockTitle }}</p>
{% endfor %}
Note that Blitz 4.18.1 (not yet released) adds field tracking to the diagnostics utility, which should make this more transparent in future.
Bug Report
I've seen this issue come up before but can't find it if I search on
matrix
, but whenever we change content in a field (ex. CKeditor) within a matrix on an Entry page the page is not marked as expired.Plugin Version
^4.10
Craft CMS Version
4.8.10
PHP Version
8.2