Fix guest author count calculations when sending test notifications
authorMatthias Schmidt <gravatronics@live.com>
Fri, 4 Aug 2017 18:04:12 +0000 (20:04 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 4 Aug 2017 18:04:12 +0000 (20:04 +0200)
wcfsetup/install/files/lib/system/user/notification/TestableUserNotificationEventHandler.class.php

index 1b7ab6468e2cbee0f1c5b1a60947716939359833..9a5a3f4f88c8252b223028a457a6e7fe116b0d2f 100644 (file)
@@ -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) {