Profile Fields
Hello Bobby
I think this question could be a continuation of https://devdojo.com/questions/profile-fields
I'm having trouble saving empty fields. After adding custom text fields test with the following steps:
- Enter data, click update
- Erase data, click update *
*The erased data appears again. Only happens with text box or multiline. Modification works fine. It's just trying to save empty fields.
Thank you
Hey there!
That is a good catch! Thank you for reporting this!
I've submitted a PR with a fix for this: https://github.com/thedevdojo/wave/pull/73
What you need to change is:
- in the
wave/src/Http/Controllers/SettingsController.phpfile, on line 64, add the following else statement:
} else {
if(!is_null($authed_user->keyValue($key))){
$keyValue = KeyValue::where('keyvalue_id', '=', $authed_user->id)->where('keyvalue_type', '=', 'users')->where('key', '=', $key)->first();
$keyValue->delete();
}
}
That way if the field is empty and if the user has that field defined previously, it will be removed from the fields table.
Let me know how it goes!
1
Yes! Problem solved.
Thank you Bobby.
1
No problem! Happy to hear that it is all working!
