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.
Comment | File | Size | Author |
---|---|---|---|
#3 | interdiff.txt | 1.33 KB | Gábor Hojtsy |
#3 | 2293773-84-migrate-only.patch | 52.87 KB | Gábor Hojtsy |
#2 | interdiff.txt | 638 bytes | Gábor Hojtsy |
#2 | migrate-dots-2.patch | 52.87 KB | Gábor Hojtsy |
migrate-dots.patch | 52.64 KB | Gábor Hojtsy | |
Comments
Comment #2
Gábor HojtsyNew stuff in user profile migration tests.
Comment #3
Gábor HojtsyUploading 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.
Comment #4
Gábor HojtsyYay, this was committed in #2293773: Field allowed values use dots in key names - not allowed in config.
Comment #6
Gábor Hojtsy