0

I'm trying to use an entity_lookup process plugin inside an entity_generate process plugin. The YML looks like this

field_validation:
    plugin: entity_generate
    access_check: false
    entity_type: node
    source: validation_name
    value_key: title
    bundle: validation
    ignore_case: true
    values:
      title: validation_name
      body: validation_description
      field_validation_type:
        plugin: entity_lookup
          access_check: false
          ignore_case: true
          source: validation_type

The error I'm getting is

Uncaught PHP Exception Drupal\Core\Config\UnsupportedDataTypeConfigException: "Invalid data type in config xxxxxx, found in xxxxxx : A colon cannot be used in an unquoted mapping value at line 282 (near " source: validation_type")." at xxxxxx line 117, referer: xxxxxx

Because I'm relatively new in using the Migrate/Migrate Plus modules, I'm not sure if the error is triggered because I'm doing something wrong with the syntax or just because I can't use entity_lookup inside an entity_generate. So, the question is: can I do something like this, or I'm forced to use a separate migration instead of entity_generate and the call it with migration_lookup?

[later edit, just for context]

my field definition:

-
 name: validation_type
 label: 'Validation Type'
 selector: $.Description.Validation[*].Type #item_selector is set to $.Schema[*]

the relevant part of the source JSON:

{
  "Schema": [
    {
      "Description": {
        "Validation": [
          {
            "Type": "CUSTOM_TYPE",
            "Description": "lorem ipsum"
          }
        ]
      }
    }
  ]
}
0

1 Answer 1

0

It seems that you actually can use entity_lookup inside entity_generate. The problem here was with the wrong indentation bellow plugin: entity_lookup. Yup... it was that kind of "bug" (feeling embarrassed) :)

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.