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.

Files: 
CommentFileSizeAuthor
#3 interdiff.txt1.33 KBGábor Hojtsy
#3 2293773-84-migrate-only.patch52.87 KBGábor Hojtsy
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch 2293773-84-migrate-only_0.patch. Unable to apply patch. See the log in the details link for more information. View
#2 interdiff.txt638 bytesGábor Hojtsy
#2 migrate-dots-2.patch52.87 KBGábor Hojtsy
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 73,158 pass(es). View
migrate-dots.patch52.64 KBGábor Hojtsy
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 73,250 pass(es), 2 fail(s), and 0 exception(s). View

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
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 73,158 pass(es). View
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
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch 2293773-84-migrate-only_0.patch. Unable to apply patch. See the log in the details link for more information. View
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)