Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Its not supported to extend config schema via hook_config_schema_info_alter
. Migrate Plus should move the "migration_group" property to a third party setting.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#9 | migration_groups_as_third_party_settings-2613336-9.patch | 9.25 KB | stBorchert |
#9 | interdiff-2613336-8-9.txt | 1.43 KB | stBorchert |
#8 | migration_groups_as_third_party_settings-2613336-8.patch | 7.74 KB | stBorchert |
#4 | 2613336-4.patch | 763 bytes | webflo |
Comments
Comment #2
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedComment #3
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedThe core change was introduced in #2414991: Prevent hook_config_schema_info_alter from adding or removing definitions.
Comment #4
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedComment #5
mikeryanDamn - I wish I had pushed harder to get groups into core for 8.0.0, the inability to modify the schema makes it hard to cleanly support them in contrib.
So, we need to do this via third party settings, which is not the best-documented D8 feature (this is the first I've heard of it). If I follow what I've read correctly, we need to add to migrate_plus.schema.yml something like
So, in a migration .yml file, we need to replace
migration_group: example_group
with... Something like this?Comment #6
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedThats correct. ConfigEntityBase implements a few handy methods to access the third party settings.
ConfigEntityBase::getThirdPartySetting(), ConfigEntityBase::setThirdPartySetting()
.$migration->getThirdPartySetting('migrate_plus', 'migration_group');
should work.Comment #7
stBorchertI'm actually creating a patch for this ...
Comment #8
stBorchertHere is the proposed patch. It is based on the branch "split".
I've updated the example files to use third_party_settings instead of the self-defined
migration_group
and changed the load-hook accordingly.I will create follow-up issue for Migrate Tools because a small change is necessary there also.
Comment #9
stBorchertForgot to update the test.
Btw.: the test fails for me (and on testbot) because of a "PluginNotFoundException". No idea, why.
Comment #11
mikeryanCommitted (with some tweaks to the example config files), thanks!