Finish the implementation of custom fields default values for checkboxes

This commit is contained in:
Ivan Nieto Vivanco
2022-02-09 13:12:42 -06:00
parent 2f3499e4b9
commit a36957dd77
3 changed files with 3 additions and 6 deletions
@@ -155,7 +155,6 @@ class AssetModelsController extends Controller
$model->requestable = $request->input('requestable', '0');
$this->removeCustomFieldsDefaultValues($model);
if ($request->input('custom_fieldset')=='') {
@@ -464,8 +463,7 @@ class AssetModelsController extends Controller
foreach ($defaultValues as $customFieldId => $defaultValue) {
if(is_array($defaultValue)){
$model->defaultValues()->attach($customFieldId, ['default_value' => implode(',', $defaultValue)]);
}
if ($defaultValue) {
}elseif ($defaultValue) {
$model->defaultValues()->attach($customFieldId, ['default_value' => $defaultValue]);
}
}