From: Alexander Ebert Date: Mon, 4 Jul 2022 11:19:01 +0000 (+0200) Subject: Fix the inconsistent return value of notifications X-Git-Tag: 5.5.0~16 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dcfac586be2f1b2fcff5b13dc3419e4c78e136c1;p=GitHub%2FWoltLab%2FWCF.git 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/ --- 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) {