admin管理员组

文章数量:1122832

I am using system_config.yaml to set the default configuration. I need to set the value of core.app.shopId but when I try to do: core.app.shopId.value: '%env(SHOP_ID)%' looks like it is working but when I logged in to the admin and tried to save the configuration in settings > basic Information I faced an error: Expected domain

As I understand this correctly domain should be core.app.shopId but in my yaml is core.app.shopId.value and this is not passing the domain validation.

I also tried to add the array:

core app.shopId:
                     value: '%env(SHOP_ID)%'

But I faced the error:

Invalid type for path "shopware.system_config.default.core.app.shopId". Expected "scalar", but got "array".

Maybe someone knows how to achieve this?

I am using system_config.yaml to set the default configuration. I need to set the value of core.app.shopId but when I try to do: core.app.shopId.value: '%env(SHOP_ID)%' looks like it is working but when I logged in to the admin and tried to save the configuration in settings > basic Information I faced an error: Expected domain

As I understand this correctly domain should be core.app.shopId but in my yaml is core.app.shopId.value and this is not passing the domain validation.

I also tried to add the array:

core app.shopId:
                     value: '%env(SHOP_ID)%'

But I faced the error:

Invalid type for path "shopware.system_config.default.core.app.shopId". Expected "scalar", but got "array".

Maybe someone knows how to achieve this?

Share Improve this question asked Nov 22, 2024 at 8:55 Martin LockeMartin Locke 1
Add a comment  | 

1 Answer 1

Reset to default 0

You need to configure core.app.shopId directly as a simple scalar value in the system_config.yaml, referencing the environment variable properly. Here's how to do it:

yaml

shopware:
  system_config:
    default:
      core.app.shopId: '%env(SHOP_ID)%'

Explanation: core.app.shopId is set directly to the value of the environment variable SHOP_ID. There's no need to use value or any nested structure—this avoids the domain validation issue.

本文标签: shopware6Shopware 6coreappshopId in systemconfigyaml to set the default configurationStack Overflow