mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 21:54:14 -08:00
resolved, missed adding errors in a case
This commit is contained in:
parent
8923206ac8
commit
afe6fe207a
|
@ -219,15 +219,15 @@ class BulkAssetsController extends Controller
|
||||||
foreach ($assetCustomFields?->fields as $field) {
|
foreach ($assetCustomFields?->fields as $field) {
|
||||||
if (array_key_exists($field->db_column, $this->update_array)) {
|
if (array_key_exists($field->db_column, $this->update_array)) {
|
||||||
$asset->{$field->db_column} = $this->update_array[$field->db_column];
|
$asset->{$field->db_column} = $this->update_array[$field->db_column];
|
||||||
$asset->save();
|
$saved = $asset->save();
|
||||||
|
if(!$saved) {
|
||||||
|
$error_bag[] = $asset->getErrors();
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
$array = $this->update_array;
|
$array = $this->update_array;
|
||||||
array_except($array, $field->db_column);
|
array_except($array, $field->db_column);
|
||||||
// $asset->update($array);
|
|
||||||
$asset->save($array);
|
$asset->save($array);
|
||||||
//call update on parent model
|
|
||||||
// $asset->save();
|
|
||||||
}
|
}
|
||||||
if (!$asset->save()) {
|
if (!$asset->save()) {
|
||||||
$error_bag[] = $asset->getErrors();
|
$error_bag[] = $asset->getErrors();
|
||||||
|
|
Loading…
Reference in a new issue