Follow-up to #2681869: Provide clean way to merge configuration into migration plugins

Problem/Motivation

MigrateUpgradeRunBatch manually sets configuration onto the migration after loading it, this should not be needed.

Proposed resolution

Find a solution.

Remaining tasks

Write a patch

User interface changes

n/a

API changes

Done in #2681869: Provide clean way to merge configuration into migration plugins

Data model changes

n/a

Comments

mikeryan created an issue. See original summary.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

heddn’s picture

Category: Bug report » Task
Status: Active » Closed (outdated)

I think we must have figured out a way to do this since a few years past. So marking closed.

wim leers’s picture

Version: 8.6.x-dev » 8.9.x-dev
Priority: Normal » Minor
Status: Closed (outdated) » Active
Issue tags: +Novice
    // @todo Find a way to avoid this in https://www.drupal.org/node/2804611.

is still in \Drupal\migrate_drupal_ui\Batch\MigrateUpgradeImportBatch. Let's remove it then :)

pefferen’s picture

created patch to remove todo, as per suggestion in comment #7

tvb’s picture

Status: Active » Reviewed & tested by the community

Manually applied the patch to 8.9.x without any issues.

The comment line with @todo is gone after applying the patch.

Setting status to RTBC.

quietone’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Novice

The todo mentioned was added in #2681869: Provide clean way to merge configuration into migration plugins and nothing has been done to find a way to not set the source_base_path in MigrateUpgradeRunBatch. In fact, I was looking at that recently at #2925899: MigrateUpgradeImportBatch does not use source_private_file_path & source_base_path correctly, making it impossible to have public & private files in separate locations and I am pretty sure that the code is still needed.

wim leers’s picture

#10: That's what I suspected actually. So you're saying that #6 is inaccurate, right?

quietone’s picture

Yes, I believe #6 is inaccurate.

This is the change committed in [#2681860]. This issue #2804611: Migrate sources and destinations need a way to get their requirements is to find a way another way to setup the source_base_path for a migration with a file destination.

+    // @todo Find a way to avoid this in https://www.drupal.org/node/2804611.
+    if ($definition['destination']['plugin'] === 'entity:file') {
      // Make sure we have a single trailing slash.
-      $source_base_path = rtrim($config['source_base_path'], '/') . '/';
-      $source = $migration->getSourceConfiguration();
-      $source['constants']['source_base_path'] = $source_base_path;
-      $migration->set('source', $source);
+      $configuration['source']['constants']['source_base_path'] = rtrim($config['source_base_path'], '/') . '/';
}

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

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Re-reading the issue that added the todo, it was in comment 2681869-#25

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.