Problem/Motivation

There are a few places in core that use the old Migration plugin, these should be refactored to use the MigrationLookup plugin or the migrate.lookup and migrate.stub services.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#25 3004929-25.drupal.patch58.48 KBmikelutz
#25 interdiff.3004929.21-25.txt1.56 KBmikelutz
#21 interdiff.3004929.18-21.txt8.08 KBmikelutz
#21 3004929-21.drupal.patch59.25 KBmikelutz
#18 interdiff.3004929.16-18.txt920 bytesmikelutz
#18 3004929-18.drupal.patch57.44 KBmikelutz
#16 interdiff.3004929.14-16.txt3.39 KBmikelutz
#16 3004929-16.drupal.patch56.54 KBmikelutz
#14 3004929-14.drupal.patch54.81 KBmikelutz
#14 interdiff.3004929.13-14.txt3.01 KBmikelutz
#13 interdiff.3004929.12-13.txt22.56 KBmikelutz
#13 3004929-13.drupal.patch51.8 KBmikelutz
#11 interdiff.3004929.9-11.txt16.64 KBmikelutz
#11 3004929-11.drupal.patch22.48 KBmikelutz
#9 interdiff.3004929.6-9.txt13.08 KBmikelutz
#9 3004929-9.drupal.patch17.47 KBmikelutz
#6 3004929-5.drupal.Fix-The-DrupalmigratePluginmigrateprocessMigration-is-deprecated-in-Drupal-840-and-will-be-removed-before-Drupal-900-Instead-use-DrupalmigratePluginmigrateprocessMigrationLookup.patch4.39 KBmikelutz
#5 3004929-5.drupal.Fix-The-DrupalmigratePluginmigrateprocessMigration-is-deprecated-in-Drupal-840-and-will-be-removed-before-Drupal-900-Instead-use-DrupalmigratePluginmigrateprocessMigrationLookup.patch1.67 KBmikelutz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikelutz created an issue. See original summary.

mikelutz’s picture

Issue tags: +Migrate critical

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mikelutz’s picture

Assigned: Unassigned » mikelutz
Issue summary: View changes
Status: Postponed » Active
Issue tags: +@deprecated, +Drupal 9

I'm reopening this, as I believe #3004927: Create Migration Lookup and Stub services Is close, and I'd like to get started on this.

mikelutz’s picture

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

mikelutz’s picture

Priority: Normal » Major

bumping priority

mikelutz’s picture

Status: Needs review » Needs work

The last submitted patch, 9: 3004929-9.drupal.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

mikelutz’s picture

Status: Needs work » Needs review
FileSize
22.48 KB
16.64 KB

Changing my approach slightly here for a better BC layer. 2 down 3 to go.

Status: Needs review » Needs work

The last submitted patch, 11: 3004929-11.drupal.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

mikelutz’s picture

Status: Needs work » Needs review
FileSize
51.8 KB
22.56 KB

Last three plugins to test, I expect there will still be cleanup.

mikelutz’s picture

Iterating some more fixes

The last submitted patch, 13: 3004929-13.drupal.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

mikelutz’s picture

Hopefully the last iteration of fixes, before I double check for any documentation cleanup.

The last submitted patch, 14: 3004929-14.drupal.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

mikelutz’s picture

Nope, one more..

The last submitted patch, 16: 3004929-16.drupal.patch, failed testing. View results

heddn’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/block/src/Plugin/migrate/process/BlockPluginId.php
    @@ -19,13 +20,27 @@
    +   * @deprecated in drupal:8.8.x and is removed from drupal:9.0.0. Use
    +   *   migrateLookup instead.
    

    I think we should make it clear that we suggest folks use the migrate.lookup service now.

  2. +++ b/core/modules/filter/src/Plugin/migrate/process/d6/FilterFormatPermission.php
    @@ -60,10 +94,23 @@ public static function create(ContainerInterface $container, array $configuratio
    +        // This BC layer is included because if the plugin constructor was called
    +        // with a migration process plugin, it may have been preconfigured with a
    

    Nit: 80 characters.

  3. +++ b/core/modules/migrate/src/Plugin/migrate/process/MenuLinkParent.php
    @@ -75,16 +126,27 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
    +    // This BC layer is included because if the plugin constructor was called
    +    // with a migration process plugin, it may have been preconfigured with a
    +    // different migration to look up against.
    

    The wording of this comment doesn't make sense to me. We've got too many plugins called 'migration'. Are we meaning the migration lookup service, the plugin, migration base plug or the legacy migration process plugin? This isn't clear.

mikelutz’s picture

heddn’s picture

I applied the patch and see things like:

            if ($this->migrationPlugin) {
              $block_id = $this->migrationPlugin
                ->transform($delta, $migrate_executable, $row, $destination_property);
            }
            else {
              $lookup_result = $this->migrateLookup->lookup(['d6_custom_block', 'd7_custom_block'], [$delta]);
              if ($lookup_result) {
                $block_id = $lookup_result[0]['id'];
              }
            }

This means we have hard coded migration names in the lookups. This isn't a good thing as it leads to BC concerns for folks using migrate_upgrade. Am I missing something though and that isn't a concern? Traditionally, we've steered away from doing this.

mikelutz’s picture

One of the five process plugins I adjusted allowed for customizing the migration ids via plugin configuration, and I kept that ability. The remaining ones all had the the migration names hardcoded in the process plugin in already. I don't like it and would like to change it, but it's out of scope for this issue.

I think it needs to be either a tag based lookup, or at least have the migration in the configuration so that migrate_upgrade can adjust it, but that needs another issue.

heddn’s picture

Status: Needs review » Reviewed & tested by the community

#3091841: Remove hardcoded plugin IDs from migration process plugins is opened to address #23. As discussed in Slack, that is an existing issue that is outside of scope of this. Let's pass this on to RTBC.

mikelutz’s picture

Version: 8.9.x-dev » 8.8.x-dev
alexpott’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Committed and pushed efc4dd9796 to 9.0.x and e8b6250313 to 8.9.x. Thanks!

+++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
@@ -122,7 +122,6 @@ public static function getSkippedDeprecations() {
-      'The Drupal\migrate\Plugin\migrate\process\Migration is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use Drupal\migrate\Plugin\migrate\process\MigrationLookup',

<3

  • alexpott committed efc4dd9 on 9.0.x
    Issue #3004929 by mikelutz, heddn: Fix 'The Drupal\migrate\Plugin\...

  • alexpott committed e8b6250 on 8.9.x
    Issue #3004929 by mikelutz, heddn: Fix 'The Drupal\migrate\Plugin\...
alexpott’s picture

Status: Patch (to be ported) » Fixed

Discussed with @catch and we agreed to backport.

  • alexpott committed 3946cf3 on 8.8.x
    Issue #3004929 by mikelutz, heddn: Fix 'The Drupal\migrate\Plugin\...

Status: Fixed » Closed (fixed)

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