From 13ab5a3dab0c36121fb3eda5075026def7619cec Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Fri, 30 Dec 2022 15:14:13 +0400 Subject: [PATCH] Fix null param value on PHP 8.1 (#6000) --- protected/humhub/modules/user/models/fieldtype/Birthday.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protected/humhub/modules/user/models/fieldtype/Birthday.php b/protected/humhub/modules/user/models/fieldtype/Birthday.php index 7ae52b0c47..07ef63b2df 100644 --- a/protected/humhub/modules/user/models/fieldtype/Birthday.php +++ b/protected/humhub/modules/user/models/fieldtype/Birthday.php @@ -176,7 +176,7 @@ class Birthday extends BaseType public function getUserValue(User $user, $raw = true): ?string { $internalName = $this->profileField->internal_name; - $birthdayDate = \DateTime::createFromFormat('Y-m-d', $user->profile->$internalName, + $birthdayDate = \DateTime::createFromFormat('Y-m-d', $user->profile->$internalName ?? '', new \DateTimeZone(Yii::$app->formatter->timeZone)); $internalNameHideAge = $this->profileField->internal_name . '_hide_year';