diff --git a/components/Posting/Posting.php b/components/Posting/Posting.php index 4719833d95..aa19fb644f 100644 --- a/components/Posting/Posting.php +++ b/components/Posting/Posting.php @@ -168,7 +168,7 @@ class Posting extends Component Actor $actor, string $content, string $content_type, - string $language, + ?string $language = null, array $attachments = [], array $processed_attachments = [], array $process_note_content_extra_args = [], @@ -181,7 +181,7 @@ class Posting extends Component 'content' => $content, 'content_type' => $content_type, 'rendered' => $rendered, - 'language_id' => Language::getByLocale($language)->getId(), + 'language_id' => !is_null($language) ? Language::getByLocale($language)->getId() : null, 'is_local' => true, ]); diff --git a/src/Entity/Note.php b/src/Entity/Note.php index f05ac1038f..7fa85d9efd 100644 --- a/src/Entity/Note.php +++ b/src/Entity/Note.php @@ -169,7 +169,7 @@ class Note extends Entity return $this; } - public function getLanguageId(): int + public function getLanguageId(): ?int { return $this->language_id; }