Skip to content

Commit

Permalink
Merge pull request #80 from jordandukart/8.x-2.x
Browse files Browse the repository at this point in the history
D9 compatability.
  • Loading branch information
nchiasson-dgi authored Oct 13, 2021
2 parents 88e3307 + 6ef1c3a commit 8ad77be
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"type": "drupal-module",
"license": "GPL-3.0-only",
"require": {
"drupal/migrate_plus": "^4.2",
"drupal/migrate_spreadsheet": "^1",
"discoverygarden/dgi_migrate": "^1"
"drupal/migrate_plus": "^4.2 || ^5.1",
"drupal/migrate_spreadsheet": "^1 || ^2",
"discoverygarden/dgi_migrate": "^1 || ^2"
}
}
2 changes: 1 addition & 1 deletion islandora_spreadsheet_ingest.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions islandora_spreadsheet_ingest.links.task.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion islandora_spreadsheet_ingest.routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Ingest/FileUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
]);
}
Expand Down
13 changes: 8 additions & 5 deletions src/MigrationDeriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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() => [
Expand Down

0 comments on commit 8ad77be

Please sign in to comment.