mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Fixes custom fields in asset listing where no custom fields were assigned
This commit is contained in:
parent
58b3f0519d
commit
6e30fa6922
|
@ -110,6 +110,8 @@ class AssetsTransformer
|
||||||
//array += $fields_array;
|
//array += $fields_array;
|
||||||
$array['custom_fields'] = $fields_array;
|
$array['custom_fields'] = $fields_array;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$array['custom_fields'] = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$permissions_array['available_actions'] = [
|
$permissions_array['available_actions'] = [
|
||||||
|
|
|
@ -256,7 +256,7 @@ $('.snipe-table').bootstrapTable({
|
||||||
// Pull out any HTMl that might be passed via the presenter
|
// Pull out any HTMl that might be passed via the presenter
|
||||||
// (for example, the locked icon for encrypted fields)
|
// (for example, the locked icon for encrypted fields)
|
||||||
var field_column_plain = field_column.replace(/<(?:.|\n)*?> ?/gm, '');
|
var field_column_plain = field_column.replace(/<(?:.|\n)*?> ?/gm, '');
|
||||||
if (row.custom_fields[field_column_plain]) {
|
if ((row.custom_fields) && (row.custom_fields[field_column_plain])) {
|
||||||
return row.custom_fields[field_column_plain].value;
|
return row.custom_fields[field_column_plain].value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue