Problem/Motivation

General problem

Configuration uses dots as a separator. However currently set() and setData() are not consistent in how they apply dots. For example the following two will do the same thing:

// These do the same thing.
$config->set('foo', array('bar' => 12);
$config->set('foo.bar', 12);

$config->get('foo');
// Will be array('bar' => 12) for both.

The following two will result in totally different things.

// These are totally different.
$config->set('foo', array('bar.baz' => 12);
$config->set('foo.bar.baz', 12);

$config->get('foo');
// Will be array('bar.baz' => 12) for the first but array('bar' => array('baz' => 12)) for the second.

This causes problems in two actual use cases now in core. This issue is for migrations.

Migrations data

Migrations use dots in key names, eg:

process:
  entity_type: constants.entity_type
  bundle: type
  field_name:
    plugin: migration
    migration: d6_taxonomy_vocabulary
    source: vid
  'settings.allowed_values.0.vocabulary': @field_name
  'settings.allowed_values.0.parent': constants.parent

Proposed resolution

Replace dots with slashes. So the above becomes:

process:
  entity_type: 'constants/entity_type'
  bundle: type
  field_name:
    plugin: migration
    migration: d6_taxonomy_vocabulary
    source: vid
  'settings/allowed_values/0/vocabulary': @field_name
  'settings/allowed_values/0/parent': 'constants/parent'

Read more at #2293773: Field allowed values use dots in key names - not allowed in config for the full discussion.

Remaining tasks

Commit.

User interface changes

None.

API changes

The migrate format will minimally change from using dots in tree references to slashes.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, migrate-dots.patch, failed testing.

Gábor Hojtsy’s picture

Status: Needs work » Needs review
FileSize
52.87 KB
638 bytes

New stuff in user profile migration tests.

Gábor Hojtsy’s picture

Title: Testing issue: migrate dot separator to slash » Migrations use dots in key names - not allowed in config
Issue summary: View changes
Issue tags: +Configuration system
FileSize
52.87 KB
1.33 KB

Uploading from #2293773-84: Field allowed values use dots in key names - not allowed in config in case we need an alternate issue to commit the patch.

Gábor Hojtsy’s picture

Status: Needs review » Closed (duplicate)

Status: Closed (duplicate) » Needs work

The last submitted patch, 3: 2293773-84-migrate-only.patch, failed testing.

Gábor Hojtsy’s picture

Status: Needs work » Closed (duplicate)