Problem/Motivation
Currently, we are using a not so nice workaround to set the `cookieless_mode` for when klaro is installed:
if (\Drupal::moduleHandler()->moduleExists('klaro') && !isset($initConfigJson['cookieless_mode'])) {
$initConfigJson['cookieless_mode'] = 'on_reject';
}
This is ok, but an alter hook, to alter the initConfigJson + a dedicated "posthog_klaro" submodule, which automatically enables the klaro "posthog" config on install (if it exists and is not already enabled) and contains a dependency on klaro in the info.yml would be nicer.
Steps to reproduce
Proposed resolution
Create an init config alter hook and a new klaro submodule to set klaro specific init settings
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #3
grevil commentedAll done, please review!
I tested it and it works as expected. Note that currently if the klaro cookies are not accepted, no "cookieless_" user is tracked, but I guess that is because the default cookieless behavior is not properly set on posthogs site and they are working on it right now?
For some reason, I could not test if the install message is shown, when installing the module via console, since for some reason drupal doesn't allow me to delete the klaro posthog config:

But the message should be shown. Even on console. Please review!
Comment #4
anybodyGREAT! Left some final comments.
Comment #5
grevil commentedAdjusted accordingly and testet the update hook! Final review please!
Comment #6
anybodyRTBC after condition cleanup! Nice work!!
Comment #8
grevil commentedMerged. Thanks!