From 1d3509ba3c38e667e1f6fc19cbb01e996d2e4d99 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Wed, 27 Dec 2023 19:50:38 +0100 Subject: [PATCH] Fix error messages --- includes/controller/shift_entries_controller.php | 2 +- includes/pages/admin_user.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/controller/shift_entries_controller.php b/includes/controller/shift_entries_controller.php index 760ff84f..0951a8a5 100644 --- a/includes/controller/shift_entries_controller.php +++ b/includes/controller/shift_entries_controller.php @@ -210,7 +210,7 @@ function shift_entry_create_controller_user(Shift $shift, AngelType $angeltype): $request = request(); $signup_user = auth()->user(); - $needed_angeltype = (new AngelType())->forceFill(NeededAngeltype_by_Shift_and_Angeltype($shift, $angeltype)); + $needed_angeltype = (new AngelType())->forceFill(NeededAngeltype_by_Shift_and_Angeltype($shift, $angeltype) ?: []); $shift_entries = $shift->shiftEntries() ->where('angel_type_id', $angeltype->id) ->get(); diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php index 6ec9bd86..fbd681c2 100644 --- a/includes/pages/admin_user.php +++ b/includes/pages/admin_user.php @@ -289,7 +289,7 @@ function admin_user() $user_source->email = $request->postData('eemail'); } - $nick = trim($request->get('eNick')); + $nick = trim((string)$request->get('eNick')); $nickValid = (new Username())->validate($nick); $changed_nick = false;