šŸ‡·šŸ‡øSerbia @norbert-goco

Subotica
Account created on 4 April 2020, over 5 years ago
#

Recent comments

šŸ‡·šŸ‡øSerbia norbert-goco Subotica

The ActionPluginDeriver class is responsible for collecting Action Plugins from contributed modules.
If you debug the getContextDefinitions() function, you can see which configuration contains a mapping whose type cannot be resolved.

In my case, it was the configuration of the domain_access module:

Configuration for the add domain(s) to users action (action.configuration.domain_access_add_editor_action)

This configuration contains a sequence within a mapping, meaning it can hold multiple values.

Therefore, in such mappings, the inner type of the sequence should be considered.

I’m attaching a patch that fixes this issue in my case — it might help others as well. If not, then further investigation is needed to identify additional cases that should be handled.

šŸ‡·šŸ‡øSerbia norbert-goco Subotica

I was in a hurry.
The number of entities in the migrate_map_* table now matches with the CSV, but the elements with the same name have a same ID (destid1), so it's still not good.

E.g.:
sourceid1, sourceid2, destid1
packaging, 1-5kg, 568
weight, 1-5kg, 568

šŸ‡·šŸ‡øSerbia norbert-goco Subotica

Ok, I figured it out. It works fine.
If bundle and bundle_key are not defined then it works dynamically, I just had to make the CSV source plugin look at the attribute when creating the mapping, not just the name: ids: [attribute, name]

So the updated YML:

source:
  plugin: csv
  path: 'modules/custom/my_module/files/product_attribute_values.csv'
  header_offset: 0
  ids: [attribute, name]

process:
  attribute: attribute
  name: name
  attribute_value_id:
    plugin: entity_lookup
    entity_type: commerce_product_attribute_value
    source: name
    value_key: name
    access_check: false

destination:
  plugin: 'entity:commerce_product_attribute_value'
šŸ‡·šŸ‡øSerbia norbert-goco Subotica

I've created a patch for Drupal 11.

šŸ‡·šŸ‡øSerbia norbert-goco Subotica

I modified the patch because when I added a country code field to the user and put it on the admin page, its value was in the value parameter, not in the country_code.

šŸ‡·šŸ‡øSerbia norbert-goco Subotica

Thanks for the patch. Also works on Drupal core 9.5.11.

Production build 0.71.5 2024