process:
  bar:
    plugin: entity_generate
    entity_type: foo
    value_key: bar
    source: bar

If foo is config entity, will cause following issue:
PHP Fatal error: Cannot access protected property XXX in /var/www/html/modules/migrate_plus/src/Plugin/migrate/process/EntityLookup.php on line 273

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jian he created an issue. See original summary.

jian he’s picture

Status: Active » Needs review
FileSize
1.28 KB
heddn’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Can we add a test for this? I think if you new up a NodeType or some such config entity, this would be a pretty easy testcase.

gnuget’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
2.71 KB
3.98 KB

I found this yesterday while I was working on a user migration.

Basically, I wanted that the entity_generate find automatically the role of the user and if the role didn't exists then created it, so I needed this patch for make entity_lookup work with config entities (the roles).

I tested the patch and works great, so I decided to write the test.

I attach the new patch and the tests-only patch.

(No interdiff this time because the test-only patch and the interdiff were equal.)

The last submitted patch, 4: 2933306-test-only-4.patch, failed testing. View results

heddn’s picture

Status: Needs review » Reviewed & tested by the community

Looking good from my angle.

  • heddn committed c7cb706 on 8.x-4.x authored by gnuget
    Issue #2933306 by gnuget, jian he, heddn: EntityLookup fatal error on...
heddn’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.