On every page load the consent banner gets visible. The reason for this is that seo:consent_revoke_before is null but if you specify the format parameter U it falls back to current timestamp.
Because of that in _consent_banner.antlers.html line 153 this condition
if (Alpine.store('consentBanner').getConsentDate() < '{{ seo:consent_revoke_before format="U" }}') {
is equal to true
I found two hotfixes for that:
update condition to if ({{ seo:consent_revoke_before ? 'true' : 'false' }} && Alpine.store('consentBanner').getConsentDate() < '{{ seo:consent_revoke_before format="U" }}') {
set the "Revoke consent before" date to past
This projects statamic version is: 5.36.0
In another project with 5.11.0 its working correct so I assume between these versions statamic changed the handling of empty date fields.
Bug description
On every page load the consent banner gets visible. The reason for this is that
seo:consent_revoke_before
is null but if you specify the format parameterU
it falls back to current timestamp.Because of that in _consent_banner.antlers.html line 153 this condition
if (Alpine.store('consentBanner').getConsentDate() < '{{ seo:consent_revoke_before format="U" }}') {
is equal totrue
I found two hotfixes for that:
if ({{ seo:consent_revoke_before ? 'true' : 'false' }} && Alpine.store('consentBanner').getConsentDate() < '{{ seo:consent_revoke_before format="U" }}') {
This projects statamic version is: 5.36.0 In another project with 5.11.0 its working correct so I assume between these versions statamic changed the handling of empty date fields.
How to reproduce
use_consent_banner
activated{{ {seo:consent_revoke_before format="U"} | dump }}
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
No response