Fixed empty Form Submissions Result in NULL Database Entries

https://github.com/LinkStackOrg/LinkStack/issues/577

https://github.com/LinkStackOrg/linkstack-docker/issues/86
This commit is contained in:
Julian Prieber 2023-09-20 14:54:26 +02:00
parent be4228cd1c
commit 6dabe3d46e
1 changed files with 4 additions and 1 deletions

View File

@ -175,7 +175,6 @@ class UserController extends Controller
$LinkTitle = ($request->link_text ?? $request->link_title) ?? $request->title;
$LinkURL = $request->link_url ?? $request->link;
$OrigLink = Link::find($request->linkid);
$customParams = [];
@ -436,6 +435,10 @@ class UserController extends Controller
$links->button_id = $button?->id;
}
if(empty($links->button_id)) {
return redirect(route('showButtons')); die;
}
$links->save();
$links->order = ($links->id - 1);