Skip to content

Commit a9cdb75

Browse files
committed
Allow payload data modification.
1 parent 1a09ca6 commit a9cdb75

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

templates/Admin/QueuedJobs/index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@
5959
<td>
6060
<?= h($queuedJob->reference) ?: '---' ?>
6161
<?php if ($queuedJob->data) {
62-
$data = VarExporter::export($queuedJob->data, VarExporter::TRAILING_COMMA_IN_ARRAY);
62+
$data = $queuedJob->data;
63+
if ($data && !is_array($data)) {
64+
$data = json_decode($queuedJob->data, true);
65+
}
66+
$data = VarExporter::export($data, VarExporter::TRAILING_COMMA_IN_ARRAY);
6367
echo $this->Icon->render('cubes', [], ['title' => $this->Text->truncate($data, 1000)]);
6468
}
6569
?>

templates/Admin/QueuedJobs/view.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,13 @@
126126
<div class="col-md-12">
127127
<h3><?= __d('queue', 'Data') ?></h3>
128128
<?php
129-
if ($queuedJob->data) {
130-
echo '<pre>' . h(VarExporter::export($queuedJob->data, VarExporter::TRAILING_COMMA_IN_ARRAY)) . '</pre>';
129+
if ($queuedJob->data) {
130+
$data = $queuedJob->data;
131+
if ($data && !is_array($data)) {
132+
$data = json_decode($queuedJob->data, true);
131133
}
134+
echo '<pre>' . h(VarExporter::export($data, VarExporter::TRAILING_COMMA_IN_ARRAY)) . '</pre>';
135+
}
132136
?>
133137
</div>
134138
</div>

0 commit comments

Comments
 (0)