Skip to content

Commit

Permalink
Allow payload data modification.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Nov 18, 2024
1 parent 1a09ca6 commit a9cdb75
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion templates/Admin/QueuedJobs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@
<td>
<?= h($queuedJob->reference) ?: '---' ?>
<?php if ($queuedJob->data) {
$data = VarExporter::export($queuedJob->data, VarExporter::TRAILING_COMMA_IN_ARRAY);
$data = $queuedJob->data;
if ($data && !is_array($data)) {
$data = json_decode($queuedJob->data, true);
}
$data = VarExporter::export($data, VarExporter::TRAILING_COMMA_IN_ARRAY);
echo $this->Icon->render('cubes', [], ['title' => $this->Text->truncate($data, 1000)]);
}
?>
Expand Down
8 changes: 6 additions & 2 deletions templates/Admin/QueuedJobs/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,13 @@
<div class="col-md-12">
<h3><?= __d('queue', 'Data') ?></h3>
<?php
if ($queuedJob->data) {
echo '<pre>' . h(VarExporter::export($queuedJob->data, VarExporter::TRAILING_COMMA_IN_ARRAY)) . '</pre>';
if ($queuedJob->data) {
$data = $queuedJob->data;
if ($data && !is_array($data)) {
$data = json_decode($queuedJob->data, true);
}
echo '<pre>' . h(VarExporter::export($data, VarExporter::TRAILING_COMMA_IN_ARRAY)) . '</pre>';
}
?>
</div>
</div>
Expand Down

0 comments on commit a9cdb75

Please sign in to comment.