webfactory / piwik-bundle

Symfony Bundle with twig-function for the Matomo (fka Piwik) tracking code
MIT License
39 stars 16 forks source link

The child node "piwik_host" at path "webfactory_piwik" must be configured. #32

Closed bperel closed 3 years ago

bperel commented 3 years ago

Hello,

Thank you for this project. When trying to set it up for the first time I get the following error:

Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!  
!!  In ArrayNode.php line 216:
!!                                                                                
!!    The child node "piwik_host" at path "webfactory_piwik" must be configured.  
!!                                                                                
!!  
!!  
Script @auto-scripts was called via post-update-cmd

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

My configuration is located in config/packages/matomo.yml and contains:

webfactory_piwik:
    site_id: 1
    piwik_host: 'example.com'
    disabled: '%kernel.debug%'
    disable_cookies: true

Am I doing something wrong?

FabianSchmick commented 3 years ago

Hey @bperel

nice to hear you are trying to use our bundle.

Since this bundle does not have any Symfony recipie, we are not creating a custom config file. So I assume you created config/packages/matomo.yml by your hand, right? If so, did you imported this file, too? So symfony knows about your configuration.

bperel commented 3 years ago

Thanks for your answer. Yes I created the file by hand. Could you guide me (or send me a documentation link) into how to make Symfony know about this file? I assumed that Symfony loaded the configuration from all the YAML files in the config directory, but I was probably wrong about that.

FabianSchmick commented 3 years ago

You could try something like this:

# config/services.yaml
imports:
    - { resource: packages/matomo.yml }

Read more at the docs

bperel commented 3 years ago

Thanks a lot @FabianSchmick ! It works without a glitch!