From 29a4b244dca307a1fd7b5e0ec4d420b4a91eb40f Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Thu, 10 Aug 2023 11:33:45 +0200 Subject: [PATCH] Fixed some smaller error messages due to null values --- includes/view/User_view.php | 5 ++--- resources/views/pages/settings/profile.twig | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/view/User_view.php b/includes/view/User_view.php index 97ea6c0c..86bb8cc8 100644 --- a/includes/view/User_view.php +++ b/includes/view/User_view.php @@ -499,9 +499,8 @@ function User_view( $goodie_tshirt = $goodie === GoodieType::Tshirt; $auth = auth(); $nightShiftsConfig = config('night_shifts'); - $user_name = htmlspecialchars( - $user_source->personalData->first_name - ) . ' ' . htmlspecialchars($user_source->personalData->last_name); + $user_name = htmlspecialchars((string) $user_source->personalData->first_name) . ' ' + . htmlspecialchars((string) $user_source->personalData->last_name); $myshifts_table = ''; if ($its_me || $admin_user_privilege || $tshirt_admin) { $my_shifts = User_view_myshifts( diff --git a/resources/views/pages/settings/profile.twig b/resources/views/pages/settings/profile.twig index cb2d2470..a9889c71 100644 --- a/resources/views/pages/settings/profile.twig +++ b/resources/views/pages/settings/profile.twig @@ -54,9 +54,10 @@ {% if config('enable_planned_arrival') %}
+ {% set planned_arrival_date = user.personalData.planned_arrival_date %} {{ f.input('planned_arrival_date', __('settings.profile.planned_arrival_date'), { 'type': 'date', - 'value': user.personalData.planned_arrival_date.format('Y-m-d'), + 'value': planned_arrival_date ? planned_arrival_date.format('Y-m-d') : '', 'required': true, 'required_icon': true, 'min': config('buildup_start') ? config('buildup_start').format('Y-m-d') : '',