From a4b30279ee719ce59ff5b9e052a18c6b294fa312 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 29 Sep 2017 03:30:13 -0700 Subject: [PATCH 1/3] Fixes #4067 - Make unrequired custom fields nullable --- app/Models/CustomFieldset.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Models/CustomFieldset.php b/app/Models/CustomFieldset.php index c89d3dd312..94188cfb6e 100644 --- a/app/Models/CustomFieldset.php +++ b/app/Models/CustomFieldset.php @@ -49,6 +49,8 @@ class CustomFieldset extends Model (($field->field_encrypted =='1') && (Gate::allows('admin')) )) { if ($field->pivot->required) { $rule[]="required"; + } else { + $rule[]="nullable"; } } From 2e76620cf8e3647a93db4e3713260294c21ced9b Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 29 Sep 2017 03:44:23 -0700 Subject: [PATCH 2/3] More specific required check --- app/Models/CustomFieldset.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/Models/CustomFieldset.php b/app/Models/CustomFieldset.php index 94188cfb6e..d0aa33aa23 100644 --- a/app/Models/CustomFieldset.php +++ b/app/Models/CustomFieldset.php @@ -47,11 +47,7 @@ class CustomFieldset extends Model if (($field->field_encrypted!='1') || (($field->field_encrypted =='1') && (Gate::allows('admin')) )) { - if ($field->pivot->required) { - $rule[]="required"; - } else { - $rule[]="nullable"; - } + $rule[] = ($field->pivot->required=='1') ? "required" : "nullable"; } array_push($rule, $field->attributes['format']); From c6069b905b0edb2bdc348fb50b4c9adcc623d0c8 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 29 Sep 2017 03:47:50 -0700 Subject: [PATCH 3/3] Bumped version --- config/version.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/version.php b/config/version.php index e13062cac6..e1e60e5a10 100644 --- a/config/version.php +++ b/config/version.php @@ -1,7 +1,7 @@ 'v4.0.5', - 'build_version' => '40', - 'hash_version' => 'g42c2a66', - 'full_hash' => 'v4.0.5-40-g42c2a66', + 'app_version' => 'v4.0.6', + 'build_version' => '47', + 'hash_version' => 'g2e76620', + 'full_hash' => 'v4.0.6-47-g2e76620', );