Skip to content

Commit

Permalink
Merge pull request #21 from FabianRutishauser/craft-5
Browse files Browse the repository at this point in the history
feat: #20 added support for streams on delete and restore actions
  • Loading branch information
engram-design authored Jan 8, 2025
2 parents 572bd71 + d2221ba commit 596ca8b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/services/Elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,13 @@ private function _getConsolidatedActions(string $elementType, array $dateRange,

foreach ($processed as $action) {
if ($action['type'] === $type) {
$data[] = Json::decode($action['data']);
// parse potential stream-resources originating from the query
if (gettype($action['data']) === 'resource'
&& get_resource_type($action['data']) === 'stream') {
$data[] = Json::decode(stream_get_contents($action['data']));
} else {
$data[] = Json::decode($action['data']);
}
}
}

Expand Down

0 comments on commit 596ca8b

Please sign in to comment.