aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2024-10-16 13:04:22 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2024-10-16 13:04:22 +0000
commit12530675e85e7ffdbee0c47d21041a9d9ab64818 (patch)
tree9b871b5d2eba0af651f26490d9381e02a261281f /lib
parent00d2a512f915e39ee11bb908f166866d3d01f905 (diff)
fix parameters html_id and avatar for PersonalNotifications::add(), fixes #4705
Closes #4705 Merge request studip/studip!3500
Diffstat (limited to 'lib')
-rw-r--r--lib/models/PersonalNotifications.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/models/PersonalNotifications.php b/lib/models/PersonalNotifications.php
index 12d9c1b..c4230b8 100644
--- a/lib/models/PersonalNotifications.php
+++ b/lib/models/PersonalNotifications.php
@@ -97,7 +97,7 @@ class PersonalNotifications extends SimpleORMap
* @param null|string $html_id : id in the html-document. If user reaches
* this html-element the notification will be marked as read, so the user
* does not need to handle the information twice. Optional. Default: null
- * @param Icon|string $avatar : either an Icon or a URL of an
+ * @param null|Icon|string $avatar : either an Icon or a URL of an
* image for the notification. Best size: 40px x 40px
* @return boolean : true on success
*/
@@ -114,10 +114,10 @@ class PersonalNotifications extends SimpleORMap
}
$notification = new self();
- $notification['html_id'] = $html_id;
+ $notification['html_id'] = $html_id ?? '';
$notification['url'] = $url;
$notification['text'] = $text;
- $notification['avatar'] = $avatar instanceof Icon ? $avatar->asImagePath(40) : $avatar;
+ $notification['avatar'] = $avatar instanceof Icon ? $avatar->asImagePath() : $avatar ?? '';
$notification['dialog'] = $dialog ? 1 : 0;
$notification->store();