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

Symfony Environment Variable Processors are not supported for EzPublishCoreBundle configs

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: High High
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      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.

        Activity

        Salvatore Pollaci created issue -
        Salvatore Pollaci made changes -
        Field Original Value New Value
        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
        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.
        Salvatore Pollaci made changes -
        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.
        As I have a multi-site setup, I need to set the root location id of my 2 siteaccesses.

        In app/config/ezplatform.yml:
        {code}
        ezpublish:
            siteaccess:
                ...
            system:
                site1:
                    content:
                        tree_root:
                            location_id: '%site1_root_location_id%'
                site2:
                    content:
                        tree_root:
                            location_id: '%site2_root_location_id%'
        {/code}

        In default_parameters.yml:
        {code}
        parameters:
            site1_root_location_id: '%env(int:SITE1_ROOT_LOCATION_ID)%'
            site2_root_location_id: '%env(int:SITE2_ROOT_LOCATION_ID)%'
        {/code}

        In parameters.yml:
        {code}
        parameters:
            env(SITE1_ROOT_LOCATION_ID): 54
            env(SITE2_ROOT_LOCATION_ID): 55
        {/code}

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

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

        {code}
        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.
        {/code}

        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.
        Salvatore Pollaci made changes -
        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:
        {code}
        ezpublish:
            siteaccess:
                ...
            system:
                site1:
                    content:
                        tree_root:
                            location_id: '%site1_root_location_id%'
                site2:
                    content:
                        tree_root:
                            location_id: '%site2_root_location_id%'
        {/code}

        In default_parameters.yml:
        {code}
        parameters:
            site1_root_location_id: '%env(int:SITE1_ROOT_LOCATION_ID)%'
            site2_root_location_id: '%env(int:SITE2_ROOT_LOCATION_ID)%'
        {/code}

        In parameters.yml:
        {code}
        parameters:
            env(SITE1_ROOT_LOCATION_ID): 54
            env(SITE2_ROOT_LOCATION_ID): 55
        {/code}

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

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

        {code}
        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.
        {/code}

        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.
        As I have a multi-site setup, I need to set the root location id of my 2 siteaccesses.

        In app/config/ezplatform.yml:
        {code}
        ezpublish:
            siteaccess:
                ...
            system:
                site1:
                    content:
                        tree_root:
                            location_id: '%site1_root_location_id%'
                site2:
                    content:
                        tree_root:
                            location_id: '%site2_root_location_id%'
        {code}

        In default_parameters.yml:
        {code}
        parameters:
            site1_root_location_id: '%env(int:SITE1_ROOT_LOCATION_ID)%'
            site2_root_location_id: '%env(int:SITE2_ROOT_LOCATION_ID)%'
        {code}

        In parameters.yml:
        {code}
        parameters:
            env(SITE1_ROOT_LOCATION_ID): 54
            env(SITE2_ROOT_LOCATION_ID): 55
        {code}

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

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

        {code}
        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.
        {code}

        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.
        André Rømcke made changes -
        Priority Blocker [ 1 ] High [ 3 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Salvatore Pollaci
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: