From d6c6d5644a6b4f18464346b371524b8deb86a2f9 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 4 Aug 2017 20:04:12 +0200 Subject: [PATCH] Fix guest author count calculations when sending test notifications --- .../TestableUserNotificationEventHandler.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/user/notification/TestableUserNotificationEventHandler.class.php b/wcfsetup/install/files/lib/system/user/notification/TestableUserNotificationEventHandler.class.php index 1b7ab6468e..9a5a3f4f88 100644 --- a/wcfsetup/install/files/lib/system/user/notification/TestableUserNotificationEventHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/TestableUserNotificationEventHandler.class.php @@ -229,7 +229,12 @@ class TestableUserNotificationEventHandler extends SingletonFactory { $events = []; foreach (LanguageFactory::getInstance()->getLanguages() as $language) { for ($authorCount = $minAuthorCount; $authorCount <= $maxAuthorCount; $authorCount++) { - for ($guestCount = $minAuthorCount ? 0 : 1; $guestCount <= $maxGuestCount; $guestCount++) { + $localMaxGuestCount = $maxGuestCount; + if (!$event->isStackable() && $authorCount) { + $localMaxGuestCount = 0; + } + + for ($guestCount = $authorCount ? 0 : 1; $guestCount <= $localMaxGuestCount; $guestCount++) { $objects = $className::getTestObjects($this->getRecipient(), $firstAuthor); foreach ($objects as $object) { -- 2.20.1