feat(04-cookie-notice-bugfix): fix CookieNoticePro injectScripts error

Phase 4 complete:

- remove undefined injectScripts calls from CookieNoticePro

- preserve Consent Mode v2 and GTM integration

- add PAUL plan, summary, and changelog
This commit is contained in:
2026-05-08 23:42:46 +02:00
parent f71a1711bb
commit df1c1f4a7d
7 changed files with 357 additions and 68 deletions

View File

@@ -2,53 +2,61 @@
## Project Reference
See: .paul/PROJECT.md (updated 2026-04-26)
See: .paul/PROJECT.md (updated 2026-05-08)
**Core value:** Uzytkownicy moga szybko i bezpiecznie kupic bilety online oraz otrzymac natychmiastowe potwierdzenie zakupu.
**Current focus:** v0.2 Analytics & Privacy — COMPLETE
**Current focus:** v0.3 Cookie Notice Hotfix - COMPLETE
## Current Position
Milestone: v0.2 Analytics & Privacy — COMPLETE
Phase: 3 of 3 (Cookie Consent Banner) Complete
Plan: 03-01 complete
Status: Milestone complete ready for next milestone
Last activity: 2026-04-26 — Phase 3 complete, v0.2 shipped
Milestone: v0.3 Cookie Notice Hotfix - COMPLETE
Phase: 1 of 1 (Cookie Notice Bugfix) - Complete
Plan: 04-01 complete
Status: Milestone complete - ready for next milestone
Last activity: 2026-05-08 - Phase 4 complete, v0.3 hotfix shipped
Progress:
- Milestone: [##########] 100%
- Phase 3: [##########] 100%
- Phase 4: [##########] 100%
## Loop Position
Current loop state:
```
PLAN ──▶ APPLY ──▶ UNIFY
[Loop complete milestone complete]
PLAN ---> APPLY ---> UNIFY
ok ok ok [Loop complete - milestone complete]
```
## Accumulated Context
### Codebase Mapped
Date: 2026-04-26
Documents: `.paul/codebase/` (8 files stack, architecture, structure, conventions, testing, integrations, concerns, db_schema)
Documents: `.paul/codebase/` (8 files - stack, architecture, structure, conventions, testing, integrations, concerns, db_schema)
### GTM Status
- GTM-TW9WCD9J już wdrożony w templates/site/layout-logged.php
- layout-unlogged.php NIE jest renderowany — view/class.Site.php zawsze używa layout-logged.php
- GTM-TW9WCD9J already integrated in templates/site/layout-logged.php.
- layout-unlogged.php is not rendered; view/class.Site.php always uses layout-logged.php.
### Decisions
- 2026-04-19: Event purchase emitowany na order-confirm, nie na przelewy24 (eliminuje falszywe konwersje).
- 2026-04-19: Payload ecommerce budowany w backendzie i serializowany bezpiecznie do widoku.
- 2026-04-26: ZMIANA — event purchase przeniesiony na przelewy24 (post-order, pre-payment). Capturuje 100% zamowien.
- 2026-04-26: cookieNoticePro.init() zamiast $.fn.cookieNoticePro() — zgodnie z dokumentacja biblioteki.
- 2026-04-26: Consent Mode v2 default-denied inicjalizowany przed GTM snippetem (wymog Google od marca 2024).
- 2026-04-19: Event purchase emitted on order-confirm, not on przelewy24.
- 2026-04-19: Ecommerce payload built in backend and safely serialized into the view.
- 2026-04-26: Event purchase moved to przelewy24 (post-order, pre-payment) to capture all orders.
- 2026-04-26: `cookieNoticePro.init()` used instead of `$.fn.cookieNoticePro()`.
- 2026-04-26: Consent Mode v2 default-denied initialized before the GTM snippet.
- 2026-05-08: Undefined `injectScripts()` calls removed from CookieNoticePro instead of adding a no-op stub.
### Cookie Consent (Phase 3 COMPLETE)
- Biblioteka: libraries/CookieNoticePro/ (skopiowana z pomysloweprezenty.pl)
- Bug naprawiony: linia ~351 — blok else teraz wysyla analytics_storage: 'denied'
- Dodatkowe poprawki: CSS initial hide dla acceptBtnSettingsLabel, Bootstrap 5 compat reset
- Consent Mode v2 init PRZED snippetem GTM w layout-logged.php
### Cookie Consent (Phase 3 - COMPLETE)
- Library: `libraries/CookieNoticePro/`.
- Analytics denied bug fixed around line 351.
- Additional fixes: CSS initial hide for `acceptBtnSettingsLabel`, Bootstrap 5 compatibility reset.
- Consent Mode v2 init is before the GTM snippet in `templates/site/layout-logged.php`.
### Cookie Notice Hotfix (Phase 4 - COMPLETE)
- Reported browser error: `Uncaught ReferenceError: injectScripts is not defined`.
- Root cause: `libraries/CookieNoticePro/cookienoticepro.script.js` called `injectScripts()` but this function was absent in the local library copy.
- Applied fix: removed both `injectScripts()` calls from `libraries/CookieNoticePro/cookienoticepro.script.js`.
- Verification passed: no `injectScripts` references remain, `node --check` passes, and layout still contains Consent Mode v2, GTM, and `cookieNoticePro.init()`.
- Summary: `.paul/phases/04-cookie-notice-bugfix/04-01-SUMMARY.md`.
### Deferred Issues
None.
@@ -57,16 +65,16 @@ None.
None.
### Git State
Last commit: 28d3815
Last commit: current phase commit (`feat(04-cookie-notice-bugfix): fix CookieNoticePro injectScripts error`)
Branch: main
Feature branches merged: none
## Session Continuity
Last session: 2026-04-26
Stopped at: v0.2 milestone complete
Next action: /paul:milestone — zdefiniuj v0.3 lub /paul:complete-milestone
Resume file: .paul/ROADMAP.md
Last session: 2026-05-08
Stopped at: v0.3 hotfix milestone complete
Next action: Start next milestone when needed
Resume file: .paul/phases/04-cookie-notice-bugfix/04-01-SUMMARY.md
---
*STATE.md - Updated after every significant action*