From 4accd412f16c3d324ea82b76822beaeaac6612bf Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Sat, 18 Sep 2021 09:16:44 -0300 Subject: [PATCH 1/4] Vers and core version req. --- composer.json | 4 ++-- islandora_spreadsheet_ingest.info.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index eb2fd79..20d3bb7 100644 --- a/composer.json +++ b/composer.json @@ -3,8 +3,8 @@ "type": "drupal-module", "license": "GPL-3.0-only", "require": { - "drupal/migrate_plus": "^4.2", + "drupal/migrate_plus": "^4.2 || ^5.1", "drupal/migrate_spreadsheet": "^1", - "discoverygarden/dgi_migrate": "^1" + "discoverygarden/dgi_migrate": "^1 || ^2" } } diff --git a/islandora_spreadsheet_ingest.info.yml b/islandora_spreadsheet_ingest.info.yml index 2315126..2669377 100644 --- a/islandora_spreadsheet_ingest.info.yml +++ b/islandora_spreadsheet_ingest.info.yml @@ -2,7 +2,7 @@ name: 'Islandora Spreadsheet Ingest' description: "Support for CSV import of Islandora content." type: module package: DGI -core: 8.x +core_version_requirement: ^8 || ^9 dependencies: # We implement a plugin making use of their base class. - drupal:migrate From 15f40b606552bcd7bf90f5704ad25115fd8d284c Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Sat, 18 Sep 2021 10:51:35 -0300 Subject: [PATCH 2/4] 2.0 of migrate_spreadsheet for d9 support. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 20d3bb7..7f9622e 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "license": "GPL-3.0-only", "require": { "drupal/migrate_plus": "^4.2 || ^5.1", - "drupal/migrate_spreadsheet": "^1", + "drupal/migrate_spreadsheet": "^1 || ^2", "discoverygarden/dgi_migrate": "^1 || ^2" } } From 96563607e40bc687fec68835ec3b0f9b3cb77692 Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Sun, 3 Oct 2021 07:11:37 -0300 Subject: [PATCH 3/4] Canonical link template defined, but one doesn't exist. --- islandora_spreadsheet_ingest.links.task.yml | 12 ++++++------ islandora_spreadsheet_ingest.routing.yml | 2 +- src/Form/Ingest/FileUpload.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/islandora_spreadsheet_ingest.links.task.yml b/islandora_spreadsheet_ingest.links.task.yml index 16673d0..2197547 100644 --- a/islandora_spreadsheet_ingest.links.task.yml +++ b/islandora_spreadsheet_ingest.links.task.yml @@ -1,17 +1,17 @@ --- -entity.isi_request.view: - route_name: entity.isi_request.view +entity.isi_request.canonical: + route_name: entity.isi_request.canonical title: View - base_route: entity.isi_request.view + base_route: entity.isi_request.canonical entity.isi_request.edit_form: route_name: entity.isi_request.edit_form title: Edit - base_route: entity.isi_request.view + base_route: entity.isi_request.canonical entity.isi_request.map_form: route_name: entity.isi_request.map_form title: Map - base_route: entity.isi_request.view + base_route: entity.isi_request.canonical entity.isi_request.activate_form: route_name: entity.isi_request.activate_form title: Activate - base_route: entity.isi_request.view + base_route: entity.isi_request.canonical diff --git a/islandora_spreadsheet_ingest.routing.yml b/islandora_spreadsheet_ingest.routing.yml index 98f2a83..6c8a590 100644 --- a/islandora_spreadsheet_ingest.routing.yml +++ b/islandora_spreadsheet_ingest.routing.yml @@ -34,7 +34,7 @@ entity.isi_request.delete_form: _entity_form: 'isi_request.delete' requirements: _entity_access: 'isi_request.delete' -entity.isi_request.view: +entity.isi_request.canonical: path: '/admin/content/islandora_spreadsheet_ingest/{isi_request}' defaults: _entity_view: 'isi_request.full' diff --git a/src/Form/Ingest/FileUpload.php b/src/Form/Ingest/FileUpload.php index a889a88..b29d4d1 100644 --- a/src/Form/Ingest/FileUpload.php +++ b/src/Form/Ingest/FileUpload.php @@ -356,7 +356,7 @@ public function save(array $form, FormStateInterface $form_state) { try { $request->save(); - $form_state->setRedirect('entity.isi_request.view', [ + $form_state->setRedirect('entity.isi_request.canonical', [ 'isi_request' => $request->id(), ]); } From 6ef1c3abdb2c339763c47a78a4a045a909897f14 Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Sun, 3 Oct 2021 07:39:50 -0300 Subject: [PATCH 4/4] Remove deprecated use of get directly. --- src/MigrationDeriver.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/MigrationDeriver.php b/src/MigrationDeriver.php index 3104574..12931fd 100644 --- a/src/MigrationDeriver.php +++ b/src/MigrationDeriver.php @@ -130,7 +130,7 @@ public function getUsedColumns(array $mappings) { * property. */ protected function mapDependencies(MigrationInterface $migration, $new_mg) { - $original_deps = $migration->get('migration_dependencies') ?? []; + $original_deps = $migration->getMigrationDependencies() ?? []; $deps = []; foreach ($original_deps as $type => $mig_deps) { @@ -176,8 +176,11 @@ protected function deriveMigrationName($mg_name, $target) { */ protected function sameMigrationGroup(MigrationInterface $mig, $target) { $loaded_target = $this->migrationPluginManager->createInstance($target); - $mg = $loaded_target->get('migration_group'); - return $mg && $mg == $mig->get('migration_group'); + // XXX: General getters were deprecated and removed in: + // https://www.drupal.org/node/2873795. Given how migrate_plus injects + // the group need to get it without it. + $mg = $loaded_target->migration_group; + return $mg && $mg == $mig->migration_group; } /** @@ -271,9 +274,9 @@ public function createAll(RequestInterface $request) { $mg_name ) ), - 'destination' => $original_migration->get('destination'), + 'destination' => $original_migration->getDestinationConfiguration(), 'dependencies' => array_merge_recursive( - $original_migration->get('dependencies'), + $original_migration->getMigrationDependencies(), [ 'enforced' => [ $request->getConfigDependencyKey() => [