Important

You are browsing upcoming documentation for version 7.1 of OroCommerce, scheduled for release in 2027. Read the documentation for the latest LTS version to get up-to-date information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

Configuration Import/Export Fields 

Filename

config_importexport_fields.yml

Root Node

config_importexport_fields

Options

The config_importexport_fields.yml file declares how a bundle’s system configuration fields behave during system configuration import and export. Every bundle may ship one; the files are collected across all bundles when the container is compiled.

A configuration value that stores a Doctrine identifier means nothing on another environment — oro_locale.default_localization = 1 is English on one instance and German on another. This file declares which fields travel as a natural key instead, and which do not travel at all.

The container build classifies a field by its form type. A field whose value it reads as a Doctrine identifier travels only when this file declares it under references, and the build logs each such field that this file declares neither under references nor under fields. A field of a password form type does not travel; declare any other field that holds a credential under fields.

The following example shows a complete file, taken from OroLocaleBundle of OroPlatform:

src/Oro/Bundle/LocaleBundle/Resources/config/oro/config_importexport_fields.yml 
 config_importexport_fields:
     references:
         oro_locale.default_localization:
             entity: Oro\Bundle\LocaleBundle\Entity\Localization
             key: name
         oro_locale.enabled_localizations:
             entity: Oro\Bundle\LocaleBundle\Entity\Localization
             key: name
             multiple: true

references 

Declares that a field stores an identifier and names the value to carry in its place. When the export carries that value, the Type column of the row gains a reference: prefix, and the import refuses a row of the field that holds a value without it, so a raw identifier is not imported by mistake.

A declaration describes the shape of the stored value, and is in exactly one of three forms: a single lookup (entity with key), a map of named lookups (members), or a map whose keys are themselves a lookup (keys). multiple turns a single lookup or a map of named lookups into a list of itself.

Each form accepts its own set of nodes and nothing else:

config_importexport_fields:
    references:

        # a single lookup                         ->  1
        <section>.<field>:
            entity: <entity class>
            key: <field of that entity>
            multiple: true            # optional  ->  [1, 2]

        # a map of named lookups                  ->  {<member name>: 1, <other members kept as is>}
        <section>.<field>:
            multiple: true            # optional  ->  a list of such maps
            members:
                <member name>:                    # every member is a single lookup
                    entity: <entity class>
                    key: <field of that entity>
                    multiple: true    # optional  ->  the member holds a list: [1, 2]

        # a map whose keys are the lookup         ->  {1: <value>, '': <value>}
        <section>.<field>:
            keys:
                entity: <entity class>
                key: <field of that entity>

A member of members is a single lookup and nothing else — the grammar is two levels deep, and no form names a service.

entity 

The entity class the stored identifier points at.

key 

The field that identifies the same row on every environment. The value it holds has to name one row. When several rows share it, the export writes the stored identifier instead and reports an error for the field, and an import refuses that row.

A key cannot name another entity in order to be identified by its natural key: there is no nested reference. The one exception is an association to localized fallback values, such as titles: the row is then identified by the string of its entry that has no localization. Any other such field belongs under fields instead.

config_importexport_fields:
    references:
        oro_locale.default_localization:
            entity: Oro\Bundle\LocaleBundle\Entity\Localization
            key: name

multiple 

The stored value is a list of what sits beside it rather than one of it, so a list is an option rather than a form of its own. It means the same thing wherever it appears, and it appears in three places, because the forms nest:

  • on a single lookup — a list of identifiers;

  • on a declaration carrying members — a list of such maps;

  • on one member of members — a list inside the map, since a member is itself a single lookup.

multiple is not available in the keys form.

config_importexport_fields:
    references:
        oro_scim.roles:
            entity: Oro\Bundle\UserBundle\Entity\Role
            key: label
            multiple: true          # stored as [2, 5]

members 

The stored value is a map, and named members of it hold identifiers. Each member is a single lookup and nothing else; the members not named in the declaration, their names and their order stay untouched.

config_importexport_fields:
    references:
        oro_scim.organization_business_units:
            members:
                organizations:
                    entity: Oro\Bundle\OrganizationBundle\Entity\Organization
                    key: name
                    multiple: true
                businessUnits:
                    entity: Oro\Bundle\OrganizationBundle\Entity\BusinessUnit
                    key: name
                    multiple: true
                # stored as {organizations: [1, 2], businessUnits: [3]}

With multiple on the declaration itself, the stored value is a list of such maps, and every map has to name each declared member:

config_importexport_fields:
    references:
        oro_pricing.default_price_lists:
            multiple: true
            members:
                priceList:
                    entity: Oro\Bundle\PricingBundle\Entity\PriceList
                    key: name
                # stored as [{priceList: 1, sort_order: 1, mergeAllowed: true}]

keys 

The stored value is a map whose keys are identifiers — a localized value keyed by localization, for instance. Every key is converted except the empty one, which is how a localized field keeps its default text. The values stay as they are, except the fallbacks of a localized value, described below. A value that holds any other object cannot be carried, and the export reports an error for the field.

A map keyed by localizations is a localized value. A localization that uses a fallback stores a FallbackType object, and the file carries it as {"fallback": "<type>"}. For a field of Oro\Bundle\LocaleBundle\Form\Type\LocalizedPropertyType, the import validates the type with the fallback field of the form, the same as the back office, when Oro\Bundle\LocaleBundle\EventListener\LocalizedPropertyImportPreValidateListener is registered for the oro_config.importexport.settings_import_prevalidate.<section>.<field> event of the field. An entry under a localization that is an array other than {"fallback": "<type>"} is refused on import.

config_importexport_fields:
    references:
        oro_cookie_consent.localized_banner_title:
            keys:
                entity: Oro\Bundle\LocaleBundle\Entity\Localization
                key: name
            # stored as {'': 'default text', 1: FallbackType('system'), ...}
            # in a file:  {"": "default text", "English (United States)": {"fallback": "system"}}

These three forms are the whole grammar. A map nested deeper than one level, or a structure whose members depend on the value of another member, has no form here; list such a key under fields with a comment naming the reason.

excluded 

fields 

Fields that store a value which must not travel, for example a credential, an identifier with no usable natural key, or the URL of the environment. The key stays visible in the export preview among the ignored fields, so an operator sees that it was left out.

State the reason in a comment — it is the only place a reader learns why the field is not carried.

config_importexport_fields:
    excluded:
        fields:
            # A content node is unique only within its catalog, so one key field cannot name it.
            - oro_web_catalog.navigation_root
            - oro_web_catalog.accessibility_page
            - oro_web_catalog.empty_search_result_page

not_fields 

Entries of the configuration tree that the preview must not show and that must not travel: a grid, a link, or a widget declared ui_only, with no stored value behind it, or a field that has no control of its own and whose value an import cannot apply — the currency grid of oro_multi_currency.allowed_currencies edits oro_multi_currency.currency_rates, and the back office copies the rates into separate entities when it saves the form, which an import does not do. Such a key is dropped from the preview, from the file, and from what an import accepts.

This node removes the key from both trees, which makes the exclusion invisible. Use fields for any other field that stores a value, so that the preview shows it among the ignored fields.

src/Oro/Bundle/EmailBundle/Resources/config/oro/config_importexport_fields.yml 
 config_importexport_fields:
     excluded:
         not_fields:
             # A grid, not a value: nothing is stored behind it.
             - oro_email.mailbox_grid

included 

Carries a single node, not_fields. A field listed there is hidden from the export preview and is still exported and imported as data. Use it for a field whose value travels but that has no control of its own — a group configurator hides the form of oro_currency.default_currency, and the currency grid of oro_multi_currency.allowed_currencies edits it — so that the preview does not list a field the operator cannot find. The node does not add a key to the export: a key that is not a field of the configuration tree is not exported, whatever this node says.

src/Oro/Bundle/MultiCurrencyBundle/Resources/config/oro/config_importexport_fields.yml 
 config_importexport_fields:
     included:
         not_fields:
             - oro_currency.default_currency

required 

The required node contains a single node, fields. The fields node lists the fields that an import must not set to an empty value. A boolean field listed here has no effect, and the container build reports it.

The import refuses an empty value of a field declared with required: true in system_configuration.yml, unless the field is a boolean, so do not list such a field here. Without that option and without this declaration, the import does not refuse a row for its empty value, even when the back office does not let a user save one; saving it can then fail. For example, the configurator of the group can add the constraints to the root form, or a listener of the saved settings can fail on an empty value. List such a field here.

A row with “Use Default” is not checked for an empty value: it resets the field, the same as the back office does.

We recommend that you state the reason in a comment, as in the example below.

To declare a required field, add it to the required.fields node of the config_importexport_fields.yml file:

src/Oro/Bundle/MultiCurrencyBundle/Resources/config/oro/config_importexport_fields.yml 
 config_importexport_fields:
     required:
         fields:
             # The configurator of the group adds the constraints to the root form, not to the field.
             - oro_currency.default_currency

labels 

A translation key naming the field on the import/export page. Use it where the field declares no label of its own — a widget, or a group standing in for several values.

src/Oro/Bundle/ShippingBundle/Resources/config/oro/config_importexport_fields.yml 
 config_importexport_fields:
     labels:
         oro_shipping.shipping_origin: 'oro.shipping.system_configuration.groups.shipping_origin.label'