From dcfac586be2f1b2fcff5b13dc3419e4c78e136c1 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 4 Jul 2022 13:19:01 +0200 Subject: [PATCH] Fix the inconsistent return value of notifications The API returned a different data structure when there are no notifications to show compared to when there are items. This causes the JS-API to break, because it always expects the later data structure. This is a regression of ec1a4a80d3a8f89105d6012ec857a7115f41c97e See https://www.woltlab.com/community/thread/296174-benachrichtigungen-werden-nicht-mehr-angezeigt/ --- .../data/user/notification/UserNotificationAction.class.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/wcfsetup/install/files/lib/data/user/notification/UserNotificationAction.class.php b/wcfsetup/install/files/lib/data/user/notification/UserNotificationAction.class.php index f10fa7d6dd..aa2b19fb89 100644 --- a/wcfsetup/install/files/lib/data/user/notification/UserNotificationAction.class.php +++ b/wcfsetup/install/files/lib/data/user/notification/UserNotificationAction.class.php @@ -224,9 +224,6 @@ class UserNotificationAction extends AbstractDatabaseObjectAction public function getNotificationData(): array { $data = UserNotificationHandler::getInstance()->getMixedNotifications(); - if ($data['count'] === 0) { - return []; - } $notifications = []; foreach ($data['notifications'] as $notificationData) { -- 2.20.1