0

I'm trying to link a field in my spreadsheet file to a user that is previously created with a migration from the same spreadsheet. The Backup column consists of multiple names divided by the backward slash (Firstname Lastname/Firstname Lastname)

migrate_plus.migration.profiles.yml:

process:
  field_backup:
    -
      plugin: explode
      delimiter: '/'
      source: 'Backup'
    -
      plugin: entity_lookup
      value_key: name
      ignore_case: true
      entity_type: user
      bundle_key: uid
      bundle: people

migrate_plus.migration.users.yml:

process:
    name:
      plugin: concat
      source:
        - 'Firstname'
        - 'Lastname'
      delimiter: ' '

The backup field is just skipped when migrating the profiles. The only error I'm getting is when i go to a profile page and check the log messages.

User error: "attributes" is an invalid render array key in Drupal\Core\Render\Element::children() (regel 97 van /var/www/html/web/core/lib/Drupal/Core/Render/Element.php) #0 /var/www/html/web/core/includes/bootstrap.inc(587): _drupal_error_handler_real(256, '"attributes" is...', '/var/www/html/w...', 97, Array) #1 [internal function]: _drupal_error_handler(256, '"attributes" is...', '/var/www/html/w...', 97, Array) #2

/var/www/html/web/core/lib/Drupal/Core/Render/Element.php(97): trigger_error('"attributes" is...', 256) #3

...

Can you not use entity_lookup for users or am I doing something wrong in my configuration?

Any help would be much appreciated

2 Answers 2

1

bundle_key is the name of the column and bundle is any value associated with that column.

In the below example the migration process will look for those column in user table whose status is 1 and uid value is equal to userid.

 plugin: entity_lookup
 source: userid
 value_key: uid
 bundle_key: status
 bundle: 1
 entity_type: user
 ignore_case: true
1
  • bundle_key is the key containing the entity bundle. It cannot be used for other fields, as it would compare those to the entity bundle in the site receiving the migration.
    – apaderno
    Jul 21, 2021 at 21:02
0

If entity_lookup is searching for users, then the bundle should also be user, since there is no people bundle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.