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.
Without listing fields in source plugin configuration I'm getting PHP Notice in the console:
Invalid argument supplied for foreach() DataParserPluginBase.php:209
and nothing really works. The reason is that XML plugin requires to list fields twice: one time in the source plugin configuration and another one - in the process configuration. We are not machines, doubling the same information is definitely a weird thing. This should be optional and can be used only for renaming.
If that's because of the ID key(s) then please create a config entry like key_selector
or something like this.
Comments
Comment #2
OnkelTem CreditAttribution: OnkelTem at Adyax commentedComment #3
Grayside CreditAttribution: Grayside at Phase2 for Norwegian Cruise Line commentedThe need to specify fields in the source and the process is part of the migrate architecture in Core itself.
The reason is that the source configuration to pull fields is an extraction phase to identify what you need, while the transformation phase in the process plugins might combine one or more of the source fields in mapping it to a given destination property.
It would not be at all difficult to write a PHP migration class that would auto-configure process configuration for every source field to use the
get
plugin or other in each case. The constructor would be a good spot in this case.I did something like that dynamic by the actual source data in #2789699, this would be even simpler to do by field definitions.
Comment #4
OnkelTem CreditAttribution: OnkelTem at Adyax commented@Grayside
> The reason is that the source configuration to pull fields is an extraction phase to identify what you need,
There's already a way to identify what I need, it is
item_selector
.Comment #5
Grayside CreditAttribution: Grayside at Phase2 for Norwegian Cruise Line commentedWhat you need is not necessarily a 1:1 mapping to what you'll use.
Comment #6
OnkelTem CreditAttribution: OnkelTem at Adyax commentedThen let 1:1 mapping be simple?
Comment #7
Grayside CreditAttribution: Grayside at Phase2 for Norwegian Cruise Line commentedBut you might not want everything to be mapped, so do you allow configuring exclusions?
That's why I'm saying there's room for something to facilitate this, but it should not be default.
Comment #8
OnkelTem CreditAttribution: OnkelTem at Adyax commented> But you might not want everything to be mapped, so do you allow configuring exclusions?
I'm not saying I need it mapped automatically, I just don't want it to look like this, where the source/fields part is just not needed at any rate:
Comment #9
heddnWhat @Grayside said in #3.
Comment #10
heddn