Skip to content

Commit

Permalink
Stripping out json metadata in the queue messages except for the ones… (
Browse files Browse the repository at this point in the history
#973)

* Stripping out json metadata in the queue messages except for the ones java is expecting

* coding standards
  • Loading branch information
dannylamb authored Sep 20, 2023
1 parent fd8319b commit e3399d3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/EventGenerator/EventGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,19 @@ public function generateEvent(EntityInterface $entity, UserInterface $user, arra
}
}

unset($data["event"]);
unset($data["queue"]);
$allowed_keys = [
"file_upload_uri",
"fedora_uri",
"source_uri",
"destination_uri",
"args",
"mimetype",
"source_field",
];
$keys_to_unset = array_diff(array_keys($data), $allowed_keys);
foreach ($keys_to_unset as $key) {
unset($data[$key]);
}

if (!empty($data)) {
$event["attachment"] = [
Expand Down

0 comments on commit e3399d3

Please sign in to comment.