Problem/Motivation
Steps to reproduce
Trigger an error in the Klaro callback JS code, e.g. enable the Posthog service, but do not use posthog.
Result: A JS error occurs and the Klaro banner is NOT shown!
Proposed resolution
Catch any kind of errors inside the callback code, ensure the Klaro banner is shown and then re-trigger the errors for the console.
Ensure the general functionality can never be broken by defective callback scripts
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | klaro-3567998-MR119-6.patch | 701 bytes | lrwebks |
| #4 | screenshot-2026-01-20 09_35_38.png | 27.24 KB | grevil |
| #4 | screenshot-2026-01-20 09_30_56.png | 24.44 KB | grevil |
Issue fork klaro-3567998
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
grevil commentedComment #4
grevil commentedThis should be it! Please review!
Before (Banner not showing):

After (Banner showing):

Comment #5
anybodyThanks @grevil! That was exactly what I thought about.
We could theoretically even add a test to ensure the banner is not more broken, if the callback throws an error.
Let @Jan Kellermann decide...
Comment #6
lrwebks commentedStatic patch until this is merged
Comment #7
anybodyWould be great if a maintainer could review this.
Comment #9
jan kellermann commentedI merged your code for next klaro release. Thank you very much.