1

I'm developing a search engine module for Drupal 8.

On a clean new Drupal website, I can install it from the admin GUI, but when I enable it I have the classical white screen (The website encountered an error ...).
Checking the error.log yields the following :

Uncaught PHP Exception Drupal\Core\Config\ConfigValueException: "gref.settings key contains a dot which is not supported." at /var/www/html/core/lib/Drupal/Core/Config/ConfigBase.php line 211, referer: http://10.113.101.197/admin/modules

But, if I go back to the website, the module is installed properly, and no further issue is reported (even when uninstalling the module).

Here is my configuration :

- config
  - install
     - views.view.grefsearch.yml
     - search_api.server.grefserver.yml
     - search_api.index.grefindex.yml
     - gref.settings.yml
     - gref.schema.yml
     - facets.facet.grefother.yml
     - block.block.gref.yml

And here is gref.settings.yml

gref:
  page_title: 'Gref Search'
  source_text: 'Lorem ipsum dolor sit amet'

Any ideas why I have this error ?

2

Okay, classical scenario, 30 seconds after I open a bounty for the question, I find the answer myself ...

I was looking into the wrong file. I started the skeleton of my module by following this tutorial.

In the "Basic Structure" section of the tutorial, dots are used in keys for the .schema.yml file. It is actually forbidden to use that, but the tutorial said you could anyway.

/config/schema/loremipsum.schema.yml :

loremipsum.settings:
  type: config_object
  label: 'Lorem Ipsum settings'
  mapping:
    loremipsum:
      type: mapping
      mapping:
        page_title:
          type: text
          label: 'Lorem ipsum generator page title:'
        source_text:
          type: text
          label: 'Source text for lorem ipsum generation:'

I removed the dot at the key, and the problem disappeared.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.