Skip to content

Commit

Permalink
Fix bug in BulkUpdate form if you have a customer LIST field.
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-unwin committed Jan 29, 2024
1 parent 57ebed0 commit ee9454c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/Views/devicesBulkUpdateForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
$item->attributes = new \stdClass();
$item->attributes->name = '';
$values[] = $item;
$valid_values = explode(',', $field->values);
$valid_values = explode(',', $field->attributes->values);
foreach ($valid_values as $key => $value) {
$item = new \stdClass();
$item->id = $value;
Expand Down Expand Up @@ -146,7 +146,11 @@
if ($key === 'icon') {
echo "<td><img src=\"" . base_url() . "device_images/" . $item->attributes->icon . ".svg\" style=\"width:40px\"></td>\n";
} else {
echo "<td>" . $item->attributes->{$key} . "</td>\n";
if (is_string($item->attributes->{$key}) or is_numeric($item->attributes->{$key})) {
echo "<td>" . $item->attributes->{$key} . "</td>\n";
} else {
echo "<td>" . json_encode($item->attributes->{$key}) . "</td>\n";
}
}
?>
<?php } ?>
Expand Down

0 comments on commit ee9454c

Please sign in to comment.