- Issue created by @travelertt
- 🇧🇷Brazil irafah
I can confirm this issue is also happening to me when I try to save the settings.
The same steps to reproduce the error. - 🇧🇷Brazil irafah
The reason why this issue happens is because of the "Replace the Agree button with "Save preferences" and "Accept all categories" buttons." that is checked by default, which makes the other two fields ("Save preferences" and "Accept all categories") to be required.
If you check the code at EuCookieComplianceConfigForm.php#L274, you will see that the default value comes from the config, and, for some reason, it is set as TRUE even before it is visible.
'#default_value' => $config->get('enable_save_preferences_button')
I tested something like
!empty($config->get('enable_save_preferences_button')) ? $config->get('enable_save_preferences_button') : FALSE,
, but it didn't work.
Perhaps because there's something set in enable_save_preferences_button, and it is considered "TRUE".I'm having some issues with my Xdebug, so, that's why I haven't had a chance to check it properly.
In case anyone can check that before me and make the necessary changes to make the field default to FALSE unless TRUE has been properly set, that would be fab.Thanks!
- 🇧🇷Brazil irafah
Hello! I investigated this issue and I noticed that
enable_save_preferences_button (Cookies categories section)
is set as TRUE in a couple of places. Why is that?I think this field should be set as
FALSE
considering that the default value for the "Consent method" is "Opt-in" not Opt-in with categories (which is the one that makes the Cookies categories visible)Otherwise, we will have this issue when configuring the module for the first time, as there are two mandatory fields hidden.
If you are not using the "Opt-in with categories" option, a workaround is to manually check "Opt-in with categories", uncheckReplace the Agree button with "Save preferences" and "Accept all categories" buttons
, then choose the option you want and configure as usual.Some places where I found it:
eu_cookie_compliance.settings.yml#L63 eu_cookie_compliance.install#L454 EuCookieComplianceMigrateTest.php#L45