From f9a3b67318f3f2bd45f1ea95335173e524c8728c Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 11 Jul 2024 15:34:36 +0000 Subject: [PATCH] Fix fatal error in notifications --- src/Navigation/Notifications/Entity/Notify.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Navigation/Notifications/Entity/Notify.php b/src/Navigation/Notifications/Entity/Notify.php index 635620ee8f..f0eec90526 100644 --- a/src/Navigation/Notifications/Entity/Notify.php +++ b/src/Navigation/Notifications/Entity/Notify.php @@ -77,7 +77,7 @@ class Notify extends BaseEntity protected $verb; /** @var string */ protected $otype; - /** @var string */ + /** @var string|null */ protected $name_cache; /** @var string|null */ protected $msg_cache; @@ -88,7 +88,7 @@ class Notify extends BaseEntity /** @var int|null */ protected $id; - public function __construct(int $type, string $name, UriInterface $url, UriInterface $photo, DateTime $date, int $uid, UriInterface $link, bool $seen, string $verb, string $otype, string $name_cache, string $msg = null, string $msg_cache = null, int $itemId = null, int $uriId = null, int $parent = null, ?int $parentUriId = null, ?int $id = null) + public function __construct(int $type, string $name, UriInterface $url, UriInterface $photo, DateTime $date, int $uid, UriInterface $link, bool $seen, string $verb, string $otype, string $name_cache = null, string $msg = null, string $msg_cache = null, int $itemId = null, int $uriId = null, int $parent = null, ?int $parentUriId = null, ?int $id = null) { $this->type = $type; $this->name = $name; @@ -118,7 +118,7 @@ class Notify extends BaseEntity public function updateMsgFromPreamble($epreamble) { $this->msg = Renderer::replaceMacros($epreamble, ['$itemlink' => $this->link->__toString()]); - $this->msg_cache = self::formatMessage($this->name_cache, BBCode::toPlaintext($this->msg, false)); + $this->msg_cache = self::formatMessage($this->name_cache ?? $this->name, BBCode::toPlaintext($this->msg, false)); } /**