From 98ec09f2c7529d13cec132b881123d395348f67b Mon Sep 17 00:00:00 2001 From: Eli Zoller Date: Thu, 25 Jul 2019 13:43:52 -0700 Subject: [PATCH] pass the event type through to alpaca, rename action, remove reaction since it can be fired with the IndexReaction --- ...stem.action.create_node_version_in_fedora.yml} | 4 ++-- src/EventGenerator/EventGenerator.php | 7 ++----- src/Plugin/ContextReaction/VersionReaction.php | 15 --------------- 3 files changed, 4 insertions(+), 22 deletions(-) rename modules/islandora_core_feature/config/install/{system.action.version_node_in_fedora.yml => system.action.create_node_version_in_fedora.yml} (75%) delete mode 100644 src/Plugin/ContextReaction/VersionReaction.php diff --git a/modules/islandora_core_feature/config/install/system.action.version_node_in_fedora.yml b/modules/islandora_core_feature/config/install/system.action.create_node_version_in_fedora.yml similarity index 75% rename from modules/islandora_core_feature/config/install/system.action.version_node_in_fedora.yml rename to modules/islandora_core_feature/config/install/system.action.create_node_version_in_fedora.yml index cc424410..bdaa1eb1 100644 --- a/modules/islandora_core_feature/config/install/system.action.version_node_in_fedora.yml +++ b/modules/islandora_core_feature/config/install/system.action.create_node_version_in_fedora.yml @@ -6,8 +6,8 @@ dependencies: - islandora_core_feature module: - islandora -id: version_node_in_fedora -label: 'Version Node in Fedora' +id: create_node_version_in_fedora +label: 'Create Node Version in Fedora' type: node plugin: emit_node_event configuration: diff --git a/src/EventGenerator/EventGenerator.php b/src/EventGenerator/EventGenerator.php index eccb0d43..4e73a145 100644 --- a/src/EventGenerator/EventGenerator.php +++ b/src/EventGenerator/EventGenerator.php @@ -104,11 +104,8 @@ class EventGenerator implements EventGeneratorInterface { $event["type"] = ucfirst($data["event"]); $event["summary"] = ucfirst($data["event"]) . " a " . ucfirst($entity_type); } - if ($data["event"] == "Update"){ - $event["object"]["createVersion"] = TRUE; - } else { - $event["object"]["createVersion"] = FALSE; - } + + $event["object"]["type"] = $event["type"]; // Add REST links for non-file entities. if ($entity_type != 'file') { diff --git a/src/Plugin/ContextReaction/VersionReaction.php b/src/Plugin/ContextReaction/VersionReaction.php deleted file mode 100644 index 67590955..00000000 --- a/src/Plugin/ContextReaction/VersionReaction.php +++ /dev/null @@ -1,15 +0,0 @@ -