diff --git a/lib/Listener/LoadMenuEntriesListener.php b/lib/Listener/LoadMenuEntriesListener.php index a5d2f80ce..9d34fbf95 100644 --- a/lib/Listener/LoadMenuEntriesListener.php +++ b/lib/Listener/LoadMenuEntriesListener.php @@ -54,6 +54,11 @@ public function handle(Event $event): void { if ($menuEntry->getAdminRequired() === 1 && !$isUserAdmin) { continue; // Skip this entry if the user is not an admin and the entry requires admin privileges } + if ($menuEntry->getDisplayName() === '') { + // An entry without a label is not renderable, and translating an empty string + // throws since the L10N strict types refactoring. + continue; + } $navigationManager->add(static function () use ($menuEntry) { $appId = $menuEntry->getAppid(); $entryName = $menuEntry->getName(); diff --git a/lib/Notifications/ExAppNotifier.php b/lib/Notifications/ExAppNotifier.php index 23b6c3d97..6efba3888 100644 --- a/lib/Notifications/ExAppNotifier.php +++ b/lib/Notifications/ExAppNotifier.php @@ -55,10 +55,13 @@ public function prepare(INotification $notification, string $languageCode): INot } $notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath(Application::APP_ID, 'app-dark.svg'))); - if (isset($parameters['rich_subject']) && isset($parameters['rich_subject_params'])) { + // Empty strings are rejected on both sides: `t('')` throws since the L10N strict types + // refactoring, and `setRichSubject('')`/`setRichMessage('')` throw an InvalidValueException. + // A notification without a message is valid, so skip what the ExApp did not provide. + if (isset($parameters['rich_subject'], $parameters['rich_subject_params']) && $parameters['rich_subject'] !== '') { $notification->setRichSubject($l->t($parameters['rich_subject']), $parameters['rich_subject_params']); } - if (isset($parameters['rich_message']) && isset($parameters['rich_message_params'])) { + if (isset($parameters['rich_message'], $parameters['rich_message_params']) && $parameters['rich_message'] !== '') { $notification->setRichMessage($l->t($parameters['rich_message']), $parameters['rich_message_params']); }