Skip to content
Snippets Groups Projects
Commit 12530675 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fix parameters html_id and avatar for PersonalNotifications::add(), fixes #4705

Closes #4705

Merge request studip/studip!3500
parent 00d2a512
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment