Resolve #3104268 "Sync id too strict3"
1 unresolved thread
Closes #3104268
Merge request reports
Activity
82 83 * Migration ID. 83 84 * @param array $sourceIds 84 85 * A set of SyncSourceIds. Gets serialized to retain its structure. 86 * @param \Drupal\migrate\Plugin\MigrateSourceInterface $source 87 * The migrate source. 85 88 * 86 89 * @throws \Exception 87 90 */ 88 public function addToSyncSourceIds(string $migrationId, array $sourceIds): void { 91 public function addToSyncSourceIds(string $migrationId, array $sourceIds, MigrateSourceInterface $source): void { We don't really need to pass the source here,
\Drupal::service('plugin.manager.migration')->createInstance($migrationId)->getSourcePlugin()
would do it. If anything, I would do the BC dance to change the migration id parameter to take the migration object instead to avoid needing to call the plugin manager.91 public function addToSyncSourceIds(string $migrationId, array $sourceIds, MigrateSourceInterface $source): void { 92 $sourceIds = $this->prepareSourceIdValues($sourceIds, $source); 93 $this->bufferedSyncIdsEntries[] = [ 94 'migration_id' => $migrationId, 91 public function addToSyncSourceIds(MigrationInterface|string $migration, array $sourceIds): void { 92 if (!$migration instanceof MigrationInterface) { 93 $migration = \Drupa::service('plugin.manager.migration')->createInstance($migration); 94 trigger_error("addToSyncSourceIds will require a migration object...", E_USER_DEPRECATED); 95 } 96 $sourceIds = $this->prepareSourceIdValues($sourceIds, $migration->getSourcePlugin()); 97 $this->bufferedSyncIdsEntries[] = [ 98 'migration_id' => $migration->id(), $migration = \Drupa::service('plugin.manager.migration')->createInstance($migration);
But this isn't the same no?
MigratePluginManager::createInstance()
accepts both plugin ID and configuration. So we also need to find the configuration for it and pass that in too right? Hard to tell, the arg exists but core does not make use of it in core/migrate/, but I imagine it must exist for a reason... maybe contrib is usingchanged this line in version 2 of the diff
added 1 commit
- a93a92e7 - Change to getting migrate object rather than adding additional argument
added 1 commit
- 777d6833 - Update deprecation to match coding standards
added 1 commit
- 9a4704eb - Ignore lack of dependency injection in deprecation call
Please register or sign in to reply