Files
Jacek Pyziak df1c1f4a7d 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
2026-05-08 23:43:17 +02:00

4.4 KiB

phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, duration, started, completed
phase plan subsystem tags requires provides affects tech-stack key-files key-decisions patterns-established duration started completed
04-cookie-notice-bugfix 01 ui
cookies
gdpr
consent-mode-v2
cookienoticepro
javascript
phase provides
03-cookie-consent CookieNoticePro integrated with Google Consent Mode v2
CookieNoticePro no longer calls undefined `injectScripts()`
Browser console hotfix for cookie acceptance and saved-consent initialization
cookies
analytics
consent-mode-v2
added patterns
keep CookieNoticePro integration minimal
preserve Consent Mode v2 flow
created modified
libraries/CookieNoticePro/cookienoticepro.script.js
Removed undefined `injectScripts()` calls instead of adding an empty compatibility stub.
Preserved `googleConsentModeHandler()` and existing layout integration unchanged.
CookieNoticePro fixes stay scoped to the vendor copy unless project integration requires layout changes.
15min 2026-05-08T00:00:00Z 2026-05-08T00:00:00Z

Phase 4 Plan 01: Cookie Notice Bugfix Summary

CookieNoticePro no longer throws ReferenceError: injectScripts is not defined during cookie acceptance or initialization with saved consent.

Performance

Metric Value
Duration ~15 min
Started 2026-05-08
Completed 2026-05-08
Tasks 2 completed
Files modified 1 source file + PAUL docs

Acceptance Criteria Results

Criterion Status Notes
AC-1: Brak ReferenceError przy akceptacji cookies Pass injectScripts() call removed from #cookieAccept handler.
AC-2: Brak ReferenceError przy zapisanych zgodach Pass injectScripts() call removed from saved-consent initialization path.
AC-3: Consent Mode pozostaje aktywny Pass googleConsentModeHandler() remains in both relevant consent paths; layout still contains Consent Mode v2, GTM, and cookieNoticePro.init().

Accomplishments

  • Removed both calls to undefined injectScripts() from libraries/CookieNoticePro/cookienoticepro.script.js.
  • Preserved the existing callback and Google Consent Mode update flow.
  • Confirmed the layout integration still loads CookieNoticePro and GTM/Consent Mode v2.

Verification Results

Check Result
rg -n "injectScripts" libraries/CookieNoticePro/cookienoticepro.script.js Pass - no matches
node --check libraries/CookieNoticePro/cookienoticepro.script.js Pass
`rg -n "cookieNoticePro.init Google Consent Mode v2

Files Created/Modified

File Change Purpose
libraries/CookieNoticePro/cookienoticepro.script.js Modified Removed undefined injectScripts() calls.
.paul/phases/04-cookie-notice-bugfix/04-01-PLAN.md Created Execution plan for the hotfix.
.paul/phases/04-cookie-notice-bugfix/04-01-SUMMARY.md Created Completion record for the hotfix.
.paul/STATE.md Modified Updated PAUL loop state for plan/apply/unify.
.paul/ROADMAP.md Modified Added and closed the v0.3 hotfix phase.

Decisions Made

Decision Rationale Impact
Remove undefined calls instead of adding a no-op injectScripts() The project does not use CookieNoticePro's script injection hook, and a no-op would hide unused behavior. Smaller, clearer fix with no global compatibility shim.
Leave layout and GTM snippets unchanged The reported bug was inside the CookieNoticePro script, not the integration layer. Lower blast radius; existing Consent Mode v2 behavior preserved.

Deviations from Plan

None - plan executed as written.

Issues Encountered

Issue Resolution
Existing PAUL files contained mixed/garbled character encoding from prior content. New hotfix PAUL entries were written in ASCII to avoid additional encoding churn.

Next Phase Readiness

Ready:

  • v0.3 hotfix is complete.
  • CookieNoticePro can be manually checked in the browser without the known injectScripts ReferenceError.

Concerns:

  • Browser console verification on production/staging should still be performed after deployment because local CLI checks cannot execute full browser interaction.

Blockers:

  • None.

Phase: 04-cookie-notice-bugfix, Plan: 01 Completed: 2026-05-08