Problem/Motivation

It currently generates a Migration config entity with the following keys: id, migration_tags, label, source, destination, process, migration_dependencies.

That means several are missing: class, field_plugin_method, cck_plugin_method.

Proposed resolution

  1. \Drupal\migrate_upgrade\MigrateUpgradeDrushRunner::export() is much more complete. Port the relevant additions from there.
  2. Every key listed in the annotations config_export needs to be handled by ::createEntityFromPlugin(). Document this.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#7 3100285-7.patch1.53 KBwim leers
#7 interdiff.txt848 byteswim leers
#2 3100285-2.patch1.69 KBwim leers

Comments

Wim Leers created an issue. See original summary.

wim leers’s picture

Status: Active » Needs review
StatusFileSize
new1.69 KB
wim leers’s picture

Title: \Drupal\migrate_plus\Entity\Migration::createEntityFromPlugin() was last updated in 2016, is incopmlete » \Drupal\migrate_plus\Entity\Migration::createEntityFromPlugin() was last updated in 2016, is incomplete
wim leers’s picture

heddn’s picture

Status: Needs review » Needs work
+++ b/src/Entity/Migration.php
@@ -79,12 +79,24 @@ class Migration extends ConfigEntityBase implements MigrationInterface {
+    if (isset($plugin_definition['cck_plugin_method'])) {
+      $migration_details['cck_plugin_method'] = $plugin_definition['cck_plugin_method'];

Could we add a trigger_error on cck? I want to be able to remove it at some point from the definition. Hmm, I want to remove it in 5.x of migrate plus since that will be the version that goes stable for core 9. Maybe don't add it at all?

wim leers’s picture

Issue tags: +Novice, +Needs reroll

WFM — since cck_plugin_method has been removed from Drupal 9 already 🥳

wim leers’s picture

Status: Needs work » Needs review
Issue tags: -Novice, -Needs reroll
StatusFileSize
new848 bytes
new1.53 KB
heddn’s picture

Status: Needs review » Reviewed & tested by the community

Would it make sense to add any test coverage of this? Otherwise, WFM.

wim leers’s picture

Writing test coverage for this is theoretically possible, but it's disproportionately much effort compared to the fix I think. I pledge to file a patch against migrate_upgrade once this lands, to make it use this, which … was the original but never executed upon intent of #2736911: Provide convenience functions for creating entities from plugins 😅

  • heddn committed 8d4f88d on 8.x-4.x authored by Wim Leers
    Issue #3100285 by Wim Leers, heddn: \Drupal\migrate_plus\Entity\...

  • heddn committed 4e25750 on 8.x-5.x authored by Wim Leers
    Issue #3100285 by Wim Leers, heddn: \Drupal\migrate_plus\Entity\...
heddn’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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