elliotttate / beatsaver-laravel

Rewrite of beatsaver.com (https://github.com/beatsaver/beatsaver) using the laravel framework
https://discord.gg/8B44zqM
MIT License
39 stars 19 forks source link

Description cannot be null #34

Closed razzeee closed 6 years ago

razzeee commented 6 years ago

If you upload a new song, you will have to fill out the title, but not the description.

If you then try to change the title on the created song, it will error out due to the description being null.

Byorun commented 6 years ago

If you (by any chance) have a dev environment you could try adding a null to empty string convert in https://github.com/Byorun/beatsaver-laravel/blob/develop/app/Http/Controllers/BeatSaverController.php#L264 and following.

razzeee commented 6 years ago

Can you let me know how the code should look, has been some time since I did php/laravel.

Byorun commented 6 years ago

something like php $variable = is_null($variable) ? '' : $variable; there are many ways to check(e.g. with a simple IF statement). You could also move that into the update function a few lines later.