Problem/Motivation

Eu Cookie Compliance works normal on a drupal 8 site but dosen't work on a lightning distribution (8.x-3.104): configuration form admin/config/system/eu-cookie-compliance dosen't submit.

This issue makes lightning distribution "unusable" for EU countries....

To reproduce: on a fresh lightning install with composer, enable eu cookie compliance module and try to change modules configuration form.

Comments

marcel66 created an issue. See original summary.

marcel66’s picture

Issue tags: +text_format

I have verified and the issue is caused by text_format in Eu Cookie Compliance config form.
For normal drupal installation the module use restricted_html text format, but lightning distribution doesn't use this format, only rich text format.

I think is normal how Eu Cookie Compliance works and should be Lightning problem to transform restricted_html to rich text, if distribution decided to don't use usual drupal formats.

Andy_D’s picture

Priority: Normal » Major

This is a serious issue considering the importance of the cookie module.

marcel66’s picture

Priority: Major » Normal

Hello,

I consider it is not a major issue because anyone may install restricted html or any configuration for text format and solve the problem.
It is also possible to change the test format in eu_cookie_compliance module...

I have created this issue because, in my opinion, if lightning maintainers have decided to remove some text formats from lightning distribution .... we should also find a solution to activate modules which use such text formats (probably transforming different text formats modules may need to lightning default text format .... if we don't want to add a new text format)....

phenaproxima’s picture

Title: EU Cookie Compliance should work on lightning » EU Cookie Compliance expects specific text formats to exist
Project: Lightning » EU Cookie Compliance (GDPR Compliance)
Version: 8.x-3.104 » 8.x-1.x-dev
Issue tags: -text_format

I'm not sure this is Lightning's problem to solve. Here's why I think so:

Text formats, like many other things in Drupal, are configuration. The nature of configuration is that, once a module is installed and its default configuration is imported, the site owns the configuration and therefore, any text format may be modified in any way. Any text format may be removed at any time for any reason.

EU Cookie Compliance, therefore, cannot assume that a specific text format always exists, and if that's what it's doing, it is mistaken.

So this, to me, is a problem with EU Cookie Compliance itself, not Lightning. I am re-titling this and moving it to the module's issue queue. Sorry!

svenryen’s picture

Category: Task » Bug report

I thought we had set a fall back to the default text format in the case Full HTML isn't available. Definitely this should be fixed. I'll look into it.

adam-vessey’s picture

Some observations: It appears that the "restricted_html" format is installed by Drupal's "standard" installation profile; therefore, "minimal" installations lack the format by default, leading to errors in the watchdog logs about the missing format...

The admin form does appear to select another format which is present; however, it requires submitting the form to make it happen.

Should this module ship its own format to use by default? Or somehow make reference to the "standard" profile's "restricted_html" format, to install it when the module is enabled, if the format is not present?

svenryen’s picture

Component: Miscellaneous » Code
Pascal-’s picture

tiikeri’s picture

I'm writing here to give a feedback, because I opened an issue which seems a duplicate: https://www.drupal.org/project/eu_cookie_compliance/issues/3109900

I'm not working with lightning distro, but the scenario is similar, because I made a migration into a drupal8 minimal profile, where the "restricted_html" format is not enabled by default. The observation of Adam in #8 may suite my case too.

In my old drupal7 site I had different machine name for "restricted HTML" format, so, into the migrated drupal8 minimal profile I enabled the module and created a "restricted_html" machine named format by my own, without CKEditor. I can give it another check, but I already tried this solution before opening my support request and didn't solved the issue.

If I will have any news about this I will let you know.

svenryen’s picture

Here's a patch that cleans up a bit after importing the install yml schema.

Test notes
- Uninstall the module
- Delete "Restricted HTML"
- Install the module again
- Verify that we are using a text format that exists; either Full HTML or the default text format for the site.

svenryen’s picture

Assigned: Unassigned » neslee canil pinto
Status: Active » Needs review

neslee canil pinto’s picture

Status: Needs review » Fixed

Committed to dev branch. Thank you.

neslee canil pinto’s picture

Assigned: neslee canil pinto » Unassigned
jollysolutions’s picture

Status: Fixed » Needs work

Trying to install with existing config built from minimal profile we get the following error with this applied

 [error]  Error: Call to a member function id() on boolean in filter_default_format() (line 214 of /home/ukna/ukna2/web/core/modules/filter/filter.module) #0 /home/ukna/ukna2/web/modules/contrib/eu_cookie_compliance/eu_cookie_compliance.install(93): filter_default_format()
#1 [internal function]: eu_cookie_compliance_install(true)
#2 /home/ukna/ukna2/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(392): call_user_func_array('eu_cookie_compl...', Array)
#3 /home/ukna/ukna2/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php(325): Drupal\Core\Extension\ModuleHandler->invoke('eu_cookie_compl...', 'install', Array)
#4 /home/ukna/ukna2/web/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array, false)
#5 /home/ukna/ukna2/web/core/lib/Drupal/Core/Config/ConfigImporter.php(813): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, false)
#6 /home/ukna/ukna2/web/core/lib/Drupal/Core/Config/ConfigImporter.php(577): Drupal\Core\Config\ConfigImporter->processExtension('module', 'install', 'eu_cookie_compl...')
#7 /home/ukna/ukna2/web/core/lib/Drupal/Core/Config/ConfigImporter.php(514): Drupal\Core\Config\ConfigImporter->processExtensions(Array)
#8 /home/ukna/ukna2/web/core/lib/Drupal/Core/Config/Importer/ConfigImporterBatch.php(31): Drupal\Core\Config\ConfigImporter->doSyncStep('processExtensio...', Array)
#9 /home/ukna/ukna2/web/core/includes/batch.inc(295): Drupal\Core\Config\Importer\ConfigImporterBatch::process(Object(Drupal\Core\Config\ConfigImporter), 'processExtensio...', Array)
#10 /home/ukna/ukna2/web/core/includes/form.inc(947): _batch_process()
#11 /home/ukna/ukna2/web/core/includes/install.core.inc(652): batch_process(Object(Drupal\Core\Url), Object(Drupal\Core\Url))
#12 /home/ukna/ukna2/web/core/includes/install.core.inc(570): install_run_task(Array, Array)
#13 /home/ukna/ukna2/web/core/includes/install.core.inc(118): install_run_tasks(Array, Array)
#14 /home/ukna/ukna2/vendor/drush/drush/includes/drush.inc(213): install_drupal(Object(Composer\Autoload\ClassLoader), Array, Array)
#15 /home/ukna/ukna2/vendor/drush/drush/includes/drush.inc(197): drush_call_user_func_array('install_drupal', Array)
#16 /home/ukna/ukna2/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php(149): drush_op('install_drupal', Object(Composer\Autoload\ClassLoader), Array, Array)
#17 [internal function]: Drush\Commands\core\SiteInstallCommands->install('minimal', Array)
#18 /home/ukna/ukna2/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#19 /home/ukna/ukna2/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#20 /home/ukna/ukna2/vendor/consolidation/annotated-command/src/CommandProcessor.php(178): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#21 /home/ukna/ukna2/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(302): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#22 /home/ukna/ukna2/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /home/ukna/ukna2/vendor/symfony/console/Application.php(1005): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /home/ukna/ukna2/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /home/ukna/ukna2/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /home/ukna/ukna2/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /home/ukna/ukna2/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /home/ukna/ukna2/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#29 /home/ukna/ukna2/vendor/drush/drush/drush(4): require('/home/ukna/ukna...')
#30 {main}.

Reverting to before the patch does not produce an error.

Webform had I similar issue which was fixed in these two issues

https://www.drupal.org/node/2890035
https://www.drupal.org/project/webform/issues/2919721

svenryen’s picture

Status: Needs work » Postponed (maintainer needs more info)

Hi @jollysolutions. I tried to reproduce.

I'm running Drupal 8.9 and EUCC 8.x-1.10. I deleted my database and reinstalled the Minimal profile. When I do that I get a Plain Text text format. And then when I install EU Cookie Compliance, I don't get this error.

Here are my steps, are there different steps to reproduce?

1. Install Minimal profile
2. Install EU Cookie Compliance

I also tried to disable the Filter module, but that's not possible when Text and Node are installed.

svenryen’s picture

Maybe you could send me your config so I can try to reproduce installing that one?

jollysolutions’s picture

StatusFileSize
new29.26 KB

steps to reproduce

1. Install drupal with minimal profile
2. Enable EU Cookie Compliance
3. Export config
4. Delete Database
5. drush si --existing-config
6. ERROR as above

Example from above included

svenryen’s picture

Right, didn't get the part where you had to import the config from the first install. I'll take a look tomorrow afternoon.

svenryen’s picture

Status: Postponed (maintainer needs more info) » Active
svenryen’s picture

Thanks. I was able to reproduce. I'm not really sure that's a module bug though. There was a text filter in the config and the module declares that it needs filter.

I'll investigate a bit further.

svenryen’s picture

I opened a new issue, since it's not related to the fix being discussed here.

#3176439: Error when installing minimal profile (config export)

svenryen’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.