PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Solved
Solved
cyberekklesia

Oct 18th, 2022 05:17 PM

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:

  1. Enter data, click update
  2. 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

bobbyiliev

Oct 19th, 2022 01:18 AM

Best Answer

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.php file, 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!

Report
1
cyberekklesia

Oct 19th, 2022 05:24 PM

Yes! Problem solved.

Thank you Bobby.

Report
1
bobbyiliev

Oct 20th, 2022 01:05 AM

No problem! Happy to hear that it is all working!