diff --git a/modules/dgi_migrate_big_set_overrides/README.md b/modules/dgi_migrate_big_set_overrides/README.md index 280ff4b6..b792e444 100644 --- a/modules/dgi_migrate_big_set_overrides/README.md +++ b/modules/dgi_migrate_big_set_overrides/README.md @@ -22,6 +22,11 @@ Big Set Overrides is responsible for doing a few main things: 2. Disables the `repository_item_media_content_sync_helper_export` context so that `content_sync` doesn't export any media during the migration. 3. Disables the default Solr index, so items are not immediately indexed upon ingest. 4. Disables the `path_alias` title generation. +5. Unsets these `content_sync` hook implementations when present so + `content_sync` doesn't continuously track entities during the migration: + * `entity_update` + * `entity_insert` + * `entity_delete` ## Installation diff --git a/modules/dgi_migrate_big_set_overrides/dgi_migrate_big_set_overrides.module b/modules/dgi_migrate_big_set_overrides/dgi_migrate_big_set_overrides.module new file mode 100644 index 00000000..81a84039 --- /dev/null +++ b/modules/dgi_migrate_big_set_overrides/dgi_migrate_big_set_overrides.module @@ -0,0 +1,27 @@ +config = $config_factory->getEditable(static::CONFIG); // XXX: Appears to be NULL on module installation; however, the requests diff --git a/modules/dgi_migrate_dspace/src/Commands/DspaceCommands.php b/modules/dgi_migrate_dspace/src/Commands/DspaceCommands.php index a70049f3..afb6c6bf 100644 --- a/modules/dgi_migrate_dspace/src/Commands/DspaceCommands.php +++ b/modules/dgi_migrate_dspace/src/Commands/DspaceCommands.php @@ -38,7 +38,7 @@ class DspaceCommands extends DrushCommands { */ public function __construct( MigrationPluginManagerInterface $migration_plugin_manager, - EntityTypeManagerInterface $entity_type_manager + EntityTypeManagerInterface $entity_type_manager, ) { $this->migrationPluginManager = $migration_plugin_manager; $this->entityTypeManager = $entity_type_manager; diff --git a/modules/dgi_migrate_foxml_standard_mods/src/Plugin/migrate/process/FoxmlFile.php b/modules/dgi_migrate_foxml_standard_mods/src/Plugin/migrate/process/FoxmlFile.php index a3b16a68..dc723853 100644 --- a/modules/dgi_migrate_foxml_standard_mods/src/Plugin/migrate/process/FoxmlFile.php +++ b/modules/dgi_migrate_foxml_standard_mods/src/Plugin/migrate/process/FoxmlFile.php @@ -51,7 +51,7 @@ public function __construct( /** * {@inheritDoc} */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, ?MigrationInterface $migration = NULL) { $configuration['method'] ??= getenv('DGI_MIGRATE_FOXML_STANDARD_MODS_FILE_METHOD') ?: 'copy'; assert(in_array($configuration['method'], ['copy', 'direct'])); /** @var \Drupal\migrate\Plugin\MigratePluginManagerInterface $process_plugin_manager */ diff --git a/modules/dgi_migrate_foxml_standard_mods/tests/src/Unit/RoleMapperTest.php b/modules/dgi_migrate_foxml_standard_mods/tests/src/Unit/RoleMapperTest.php index 5f76bef1..ba638ccb 100644 --- a/modules/dgi_migrate_foxml_standard_mods/tests/src/Unit/RoleMapperTest.php +++ b/modules/dgi_migrate_foxml_standard_mods/tests/src/Unit/RoleMapperTest.php @@ -2,8 +2,8 @@ namespace Drupal\Tests\dgi_migrate_foxml_standard_mods\Unit; -use Drupal\dgi_migrate_foxml_standard_mods\Plugin\migrate\process\TypedRelation; use Drupal\Tests\UnitTestCase; +use Drupal\dgi_migrate_foxml_standard_mods\Plugin\migrate\process\TypedRelation; /** * Test out the role mapper. diff --git a/modules/dgi_migrate_imagemagick_cleanup/src/EventSubscriber/EventSubscriber.php b/modules/dgi_migrate_imagemagick_cleanup/src/EventSubscriber/EventSubscriber.php index 9f38f684..98ef8592 100644 --- a/modules/dgi_migrate_imagemagick_cleanup/src/EventSubscriber/EventSubscriber.php +++ b/modules/dgi_migrate_imagemagick_cleanup/src/EventSubscriber/EventSubscriber.php @@ -73,7 +73,7 @@ public function __construct( LoggerInterface $logger, FileSystemInterface $file_system, StreamWrapperManagerInterface $stream_wrapper_manager, - EventDispatcherInterface $event_dispatcher + EventDispatcherInterface $event_dispatcher, ) { $this->logger = $logger; $this->fileSystem = $file_system; diff --git a/modules/dgi_migrate_regenerate_pathauto_aliases/src/Commands/Pathauto.php b/modules/dgi_migrate_regenerate_pathauto_aliases/src/Commands/Pathauto.php index 9d0dd54d..ece58ebe 100644 --- a/modules/dgi_migrate_regenerate_pathauto_aliases/src/Commands/Pathauto.php +++ b/modules/dgi_migrate_regenerate_pathauto_aliases/src/Commands/Pathauto.php @@ -70,9 +70,11 @@ public function __construct(PathautoGeneratorInterface $pathauto_generator, Enti * @validate-module-enabled islandora_drush_utils * @islandora-drush-utils-user-wrap */ - public function regenerate($options = [ - 'bundle' => 'islandora_object', - ]) { + public function regenerate( + $options = [ + 'bundle' => 'islandora_object', + ], + ) { $bundles = $this->entityTypeBundleInfo->getBundleInfo('node'); if (!isset($bundles[$options['bundle']])) { diff --git a/src/Drush/Commands/MigrateCommands.php b/src/Drush/Commands/MigrateCommands.php index 64cf9c7b..8f98c104 100644 --- a/src/Drush/Commands/MigrateCommands.php +++ b/src/Drush/Commands/MigrateCommands.php @@ -78,22 +78,25 @@ class MigrateCommands extends MigrateToolsCommands { * @throws \Exception * If there are not enough parameters to the command. */ - public function batchImport($migration_names = '', array $options = [ - 'all' => FALSE, - 'group' => self::REQ, - 'tag' => self::REQ, - 'limit' => self::REQ, - 'feedback' => self::REQ, - 'idlist' => self::REQ, - 'idlist-delimiter' => MigrateTools::DEFAULT_ID_LIST_DELIMITER, - 'update' => FALSE, - 'force' => FALSE, - 'continue-on-failure' => FALSE, - 'execute-dependencies' => FALSE, - 'skip-progress-bar' => FALSE, - 'sync' => FALSE, - 'run' => NULL, - ]) : void { + public function batchImport( + $migration_names = '', + array $options = [ + 'all' => FALSE, + 'group' => self::REQ, + 'tag' => self::REQ, + 'limit' => self::REQ, + 'feedback' => self::REQ, + 'idlist' => self::REQ, + 'idlist-delimiter' => MigrateTools::DEFAULT_ID_LIST_DELIMITER, + 'update' => FALSE, + 'force' => FALSE, + 'continue-on-failure' => FALSE, + 'execute-dependencies' => FALSE, + 'skip-progress-bar' => FALSE, + 'sync' => FALSE, + 'run' => NULL, + ], + ) : void { parent::import($migration_names, $options); } @@ -233,18 +236,21 @@ protected function executeMigration(MigrationInterface $migration, $migration_id * @throws \Exception * If there are not enough parameters to the command. */ - public function rollback($migration_names = '', array $options = [ - 'all' => FALSE, - 'group' => self::REQ, - 'tag' => self::REQ, - 'feedback' => self::REQ, - 'idlist' => self::REQ, - 'idlist-delimiter' => MigrateTools::DEFAULT_ID_LIST_DELIMITER, - 'skip-progress-bar' => FALSE, - 'continue-on-failure' => FALSE, - 'statuses' => self::REQ, - 'run' => NULL, - ]) : void { + public function rollback( + $migration_names = '', + array $options = [ + 'all' => FALSE, + 'group' => self::REQ, + 'tag' => self::REQ, + 'feedback' => self::REQ, + 'idlist' => self::REQ, + 'idlist-delimiter' => MigrateTools::DEFAULT_ID_LIST_DELIMITER, + 'skip-progress-bar' => FALSE, + 'continue-on-failure' => FALSE, + 'statuses' => self::REQ, + 'run' => NULL, + ], + ) : void { $group_names = $options['group']; $tag_names = $options['tag']; $all = $options['all']; @@ -316,13 +322,15 @@ public function rollback($migration_names = '', array $options = [ * @option tag Name of the migration tag to import. * @option sort Sort according to weight. */ - public function listMigrations(array $options = [ - 'all' => FALSE, - 'group' => self::REQ, - 'tag' => self::REQ, - 'format' => 'csv', - 'sort' => FALSE, - ]) : RowsOfFields { + public function listMigrations( + array $options = [ + 'all' => FALSE, + 'group' => self::REQ, + 'tag' => self::REQ, + 'format' => 'csv', + 'sort' => FALSE, + ], + ) : RowsOfFields { $generate_order = function () use ($options) { $migration_groups = $this->migrationsList('', $options); @@ -421,11 +429,14 @@ protected static function getMigrateToolsLogger() : LoggerInterface { * * @islandora-drush-utils-user-wrap */ - public function enqueueMigration(string $migration_id, array $options = [ - 'update' => FALSE, - 'sync' => FALSE, - 'run' => NULL, - ]) : void { + public function enqueueMigration( + string $migration_id, + array $options = [ + 'update' => FALSE, + 'sync' => FALSE, + 'run' => NULL, + ], + ) : void { $executable = $this->getExecutable($migration_id, $options); // drush_op() provides --simulate support. drush_op([$executable, 'prepareBatch']); @@ -444,11 +455,14 @@ public function enqueueMigration(string $migration_id, array $options = [ * * @islandora-drush-utils-user-wrap */ - public function processEnqueuedMigration(string $migration_id, array $options = [ - 'update' => FALSE, - 'sync' => FALSE, - 'run' => NULL, - ]) : void { + public function processEnqueuedMigration( + string $migration_id, + array $options = [ + 'update' => FALSE, + 'sync' => FALSE, + 'run' => NULL, + ], + ) : void { $executable = $this->getExecutable($migration_id, $options); // drush_op() provides --simulate support. $batch = [ @@ -482,11 +496,14 @@ public function processEnqueuedMigration(string $migration_id, array $options = * * @islandora-drush-utils-user-wrap */ - public function finishEnqueuedMigration(string $migration_id, array $options = [ - 'update' => FALSE, - 'sync' => FALSE, - 'run' => NULL, - ]) { + public function finishEnqueuedMigration( + string $migration_id, + array $options = [ + 'update' => FALSE, + 'sync' => FALSE, + 'run' => NULL, + ], + ) { $executable = $this->getExecutable($migration_id, $options); drush_op([$executable, 'teardownMigration']); } @@ -501,9 +518,13 @@ public function finishEnqueuedMigration(string $migration_id, array $options = [ * * @command dgi-migrate:enqueue-terminal */ - public function enqueueTerminal(string $migration_id, string $run_id, array $options = [ - 'priority' => 4, - ]) { + public function enqueueTerminal( + string $migration_id, + string $run_id, + array $options = [ + 'priority' => 4, + ], + ) { $stomp_queue = StompQueue::create($migration_id, $run_id); $stomp_queue->sendTerminal([ 'priority' => $options['priority'] ?? 4, diff --git a/src/Plugin/migrate/destination/DgiRevisionedEntity.php b/src/Plugin/migrate/destination/DgiRevisionedEntity.php index 6a35a8b8..bc53f604 100644 --- a/src/Plugin/migrate/destination/DgiRevisionedEntity.php +++ b/src/Plugin/migrate/destination/DgiRevisionedEntity.php @@ -4,9 +4,9 @@ use Drupal\Core\Entity\ContentEntityInterface; use Drupal\migrate\MigrateException; -use Drupal\migrate\Plugin\migrate\destination\EntityContentBase; use Drupal\migrate\Plugin\MigrateIdMapInterface; use Drupal\migrate\Plugin\MigrationInterface; +use Drupal\migrate\Plugin\migrate\destination\EntityContentBase; use Drupal\migrate\Row; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -42,7 +42,7 @@ class DgiRevisionedEntity extends EntityContentBase { /** * {@inheritdoc} */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, ?MigrationInterface $migration = NULL) { $entity_type = $configuration['entity_type'] ?? 'node'; $instance = parent::create($container, $configuration, 'entity:' . $entity_type, $plugin_definition, $migration); $instance->entityType = $entity_type; diff --git a/src/Plugin/migrate/id_map/SmartSql.php b/src/Plugin/migrate/id_map/SmartSql.php index 5f24241c..1aeffec1 100644 --- a/src/Plugin/migrate/id_map/SmartSql.php +++ b/src/Plugin/migrate/id_map/SmartSql.php @@ -6,11 +6,11 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\migrate\EntityFieldDefinitionTrait; use Drupal\migrate\MigrateException; -use Drupal\migrate\Plugin\migrate\destination\Entity; -use Drupal\migrate\Plugin\migrate\id_map\Sql; use Drupal\migrate\Plugin\MigrateIdMapInterface; use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Plugin\MigrationPluginManagerInterface; +use Drupal\migrate\Plugin\migrate\destination\Entity; +use Drupal\migrate\Plugin\migrate\id_map\Sql; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -108,7 +108,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition /** * {@inheritdoc} */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, ?MigrationInterface $migration = NULL) { return parent::create($container, $configuration, $plugin_id, $plugin_definition, $migration) ->setEntityTypeManager($container->get('entity_type.manager')); } diff --git a/src/Plugin/migrate/process/DetermineExtension.php b/src/Plugin/migrate/process/DetermineExtension.php index 7f84a07d..50db94ee 100644 --- a/src/Plugin/migrate/process/DetermineExtension.php +++ b/src/Plugin/migrate/process/DetermineExtension.php @@ -35,7 +35,7 @@ class DetermineExtension extends ProcessPluginBase { /** * Constructor. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, ?MigrationInterface $migration = NULL) { parent::__construct($configuration, $plugin_id, $plugin_definition, $migration); $this->mimeTypes = new MimeTypes(); diff --git a/src/Plugin/migrate/process/LockingMigrationLookup.php b/src/Plugin/migrate/process/LockingMigrationLookup.php index 0a4c6e09..bdecd296 100644 --- a/src/Plugin/migrate/process/LockingMigrationLookup.php +++ b/src/Plugin/migrate/process/LockingMigrationLookup.php @@ -578,7 +578,7 @@ protected function doStub(&$context) { /** * {@inheritDoc} */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, ?MigrationInterface $migration = NULL) { $instance = new static($configuration, $plugin_id, $plugin_definition); /** @var \Drupal\Component\Plugin\PluginManagerInterface $process_plugin_manager */ diff --git a/src/Plugin/migrate/process/NaiveFileCopy.php b/src/Plugin/migrate/process/NaiveFileCopy.php index 1087baee..2cf15499 100644 --- a/src/Plugin/migrate/process/NaiveFileCopy.php +++ b/src/Plugin/migrate/process/NaiveFileCopy.php @@ -9,8 +9,8 @@ use Drupal\Core\StreamWrapper\StreamWrapperManagerInterface; use Drupal\migrate\MigrateException; use Drupal\migrate\MigrateExecutableInterface; -use Drupal\migrate\Plugin\migrate\process\FileCopy; use Drupal\migrate\Plugin\MigrateProcessInterface; +use Drupal\migrate\Plugin\migrate\process\FileCopy; use Drupal\migrate\Row; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/src/Plugin/migrate/process/RequiredEntityLookup.php b/src/Plugin/migrate/process/RequiredEntityLookup.php index c8a5e627..443b50b1 100644 --- a/src/Plugin/migrate/process/RequiredEntityLookup.php +++ b/src/Plugin/migrate/process/RequiredEntityLookup.php @@ -28,7 +28,7 @@ class RequiredEntityLookup extends EntityLookup { /** * {@inheritdoc} */ - public static function create(ContainerInterface $container, array $configuration, $pluginId, $pluginDefinition, MigrationInterface $migration = NULL) { + public static function create(ContainerInterface $container, array $configuration, $pluginId, $pluginDefinition, ?MigrationInterface $migration = NULL) { $instance = parent::create($container, $configuration, $pluginId, $pluginDefinition, $migration); $instance->missingBehaviorInit(); diff --git a/src/Plugin/migrate/process/StaticMap.php b/src/Plugin/migrate/process/StaticMap.php index 7360ce17..6396699b 100644 --- a/src/Plugin/migrate/process/StaticMap.php +++ b/src/Plugin/migrate/process/StaticMap.php @@ -5,8 +5,8 @@ use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\MigrateSkipProcessException; use Drupal\migrate\MigrateSkipRowException; -use Drupal\migrate\Plugin\migrate\process\StaticMap as Upstream; use Drupal\migrate\Plugin\MigrationInterface; +use Drupal\migrate\Plugin\migrate\process\StaticMap as Upstream; use Drupal\migrate\Row; /** diff --git a/src/Plugin/migrate/source/Migration.php b/src/Plugin/migrate/source/Migration.php index 2872c788..e3fae6ed 100644 --- a/src/Plugin/migrate/source/Migration.php +++ b/src/Plugin/migrate/source/Migration.php @@ -4,9 +4,9 @@ use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\dgi_migrate\MigrationIterator; -use Drupal\migrate\Plugin\migrate\source\SourcePluginBase; use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Plugin\MigrationPluginManagerInterface; +use Drupal\migrate\Plugin\migrate\source\SourcePluginBase; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -45,7 +45,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition /** * {@inheritdoc} */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, ?MigrationInterface $migration = NULL) { return new static( $configuration, $plugin_id, diff --git a/src/StompQueue.php b/src/StompQueue.php index bd9ef9ee..aace2c03 100644 --- a/src/StompQueue.php +++ b/src/StompQueue.php @@ -67,7 +67,7 @@ public function __construct( IStateful $stomp, LoggerInterface $logger, string $name, - string $group + string $group, ) { $this->stomp = $stomp; $this->logger = $logger;