Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-30134

Symfony Environment Variable Processors are not supported for EzPublishCoreBundle configs

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: High High
    • None
    • None
    • None
    • None

    Description

      As I have a multi-site setup, I need to set the root location id of my 2 siteaccesses.

      In app/config/ezplatform.yml:

      ezpublish:
          siteaccess:
              ...
          system:
              site1:
                  content:
                      tree_root:
                          location_id: '%site1_root_location_id%'
              site2:
                  content:
                      tree_root:
                          location_id: '%site2_root_location_id%'
      

      In default_parameters.yml:

      parameters:
          site1_root_location_id:   '%env(int:SITE1_ROOT_LOCATION_ID)%'
          site2_root_location_id:   '%env(int:SITE2_ROOT_LOCATION_ID)%'
      

      In parameters.yml:

      parameters:
          env(SITE1_ROOT_LOCATION_ID): 54
          env(SITE2_ROOT_LOCATION_ID): 55
      

      Resource:

      https://symfony.com/doc/3.4/configuration/external_parameters.html#environment-variable-processors
      

      Now when I run bin/console cli command I get the following error:
      www-data@827933aa2119:~/html/project/ezplatform$ bin/console

      In IntegerNode.php line 29:
      
        Invalid type for path "ezpublish.system.site1.content.tree_root.location_id". Expected int, but got string.
        Hint: Root locationId for routing and link generation.
        Useful for multisite apps with one repository.
      

      Observation:
      I have noticed that eZ\Bundle\EzPublishCoreBundle\DependencyInjection\EzPublishCoreExtension::getConfiguration() is called before Symfony\Component\DependencyInjection\EnvVarProcessor is istantiated.
      Infact all my other Environment Variables using the 'int' processor are working correctly.

      Attachments

        Activity

          People

            Unassigned Unassigned
            salvatore.pollaci@innoteam.it salvatore.pollaci@innoteam.it
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: