diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.php index 02d9404556..f1a8c85c20 100755 --- a/app/Http/Controllers/AssetModelsController.php +++ b/app/Http/Controllers/AssetModelsController.php @@ -11,6 +11,7 @@ use App\Models\User; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Input; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\Validator; use Redirect; @@ -513,9 +514,8 @@ class AssetModelsController extends Controller $validator = Validator::make($data, $rules); - // Okay, this is the problem. Seems to be failing every time, kind of makes sense because it looks like - // $rules is an empty array, but I need to wrap my head around this entire method a little more. if($validator->fails()){ + Log::debug($validator->errors()); return false; } diff --git a/app/Models/CustomFieldset.php b/app/Models/CustomFieldset.php index a62f96d631..0d0f3974ff 100644 --- a/app/Models/CustomFieldset.php +++ b/app/Models/CustomFieldset.php @@ -92,8 +92,11 @@ class CustomFieldset extends Model array_push($rule, $field->attributes['format']); $rules[$field->db_column_name()] = $rule; - //add not_array to rules for all fields - $rules[$field->db_column_name()][] = 'not_array'; + // add not_array to rules for all fields + // condition added to fix issue with model default updates + if ($field->element != 'checkbox') { + $rules[$field->db_column_name()][] = 'not_array'; + } } return $rules;