studio1902 / statamic-peak-seo

Belongs to the Statamic Peak Starter Kit and contains all SEO fieldsets and partials.
GNU General Public License v3.0
12 stars 14 forks source link

Consent banner incorrect invalidation #48

Closed dally-dally closed 2 days ago

dally-dally commented 3 days ago

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 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:

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

Logs

No response

Environment

Environment
Application Name: XXX
Laravel Version: 11.29.0
PHP Version: 8.3.10
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: xxx
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: null
Cache: file
Database: sqlite
Logs: stack / daily
Mail: smtp
Queue: sync
Session: file

Livewire
Livewire: v3.5.12

Statamic
Addons: 4
Sites: 2 (English, German)
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.36.0 PRO

Statamic Addons
edalzell/forma: 3.0.1
jonassiewertsen/statamic-livewire: 3.8.1
mitydigital/statamic-scheduled-cache-invalidator: 2.1.0
studio1902/statamic-peak-seo: 8.16.0

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

None

Additional details

No response

robdekort commented 2 days ago

What a great find. Thank you! Fix incoming.