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

0

If your entity_lookup is searching Users then the bundle, I think, should also be user since there is no people bundle.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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