Skip to content

Commit

Permalink
8.1.6
Browse files Browse the repository at this point in the history
D8CORE-2914 Flag content as needs updating on orphan unpublishing (#18) (2d711a2)
  • Loading branch information
pookmish authored Nov 9, 2020
2 parents 4b9ff87 + e660990 commit 13984cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Stanford Migrate

8.x-1.6
--------------------------------------------------------------------------------
_Release Date: 2020-11-06_

- D8CORE-2914 Flag content as needs updating on orphan unpublishing (#18) (2d711a2)

8.x-1.5
--------------------------------------------------------------------------------
_Release Date: 2020-10-19_
Expand Down
2 changes: 2 additions & 0 deletions src/EventSubscriber/EventsSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public function postImport(MigrateImportEvent $event) {

// Delete the entity, then the record in the id map.
$entity->delete();
$id_map->delete($id_map->currentSource());
break;

case self::ORPHAN_UNPUBLISH:
Expand All @@ -179,6 +180,7 @@ public function postImport(MigrateImportEvent $event) {
$entity->set('revision_log', 'Unpublished content since it no longer exists in the source data');
}
$entity->set($status_key, 0)->save();
$id_map->setUpdate($id_map->currentSource());

$this->logger->notice($this->t('Unpublished entity since it no longer exists in the source data. Migration: @migration, Entity Type: @entity_type, Label: @label'), [
'@migration' => $event->getMigration()->label(),
Expand Down
2 changes: 1 addition & 1 deletion stanford_migrate.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: 'Adds more functionality to migrate and migrate plus modules'
type: module
core_version_requirement: ^8.8 || ^9
package: 'Stanford'
version: 8.x-1.5
version: 8.x-1.6
dependencies:
- drupal:migrate
- migrate_plus:migrate_plus
Expand Down

0 comments on commit 13984cf

Please sign in to comment.