[ENTITY][Note] Language in notes is optional

This commit is contained in:
Diogo Peralta Cordeiro 2021-12-12 06:33:58 +00:00
parent 1d09a02ad6
commit 93fa7eb0b5
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
1 changed files with 6 additions and 1 deletions

View File

@ -350,7 +350,12 @@ class Note extends Entity
{
$rendered = null;
$mentions = [];
Event::handle('RenderNoteContent', [$this->getContent(), $this->getContentType(), &$rendered, $this->getActor(), Language::getById($this->getLanguageId())->getLocale(), &$mentions]);
Event::handle('RenderNoteContent', [$this->getContent(),
$this->getContentType(),
&$rendered,
$this->getActor(),
is_null($this->getLanguageId()) ? null : Language::getById($this->getLanguageId())->getLocale(),
&$mentions]);
$mentioned = [];
foreach ($mentions as $mention) {
foreach ($mention['mentioned'] as $m) {