Fix application of user limit in birthday box
authorMatthias Schmidt <gravatronics@live.com>
Sat, 4 Jan 2020 12:47:08 +0000 (13:47 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 4 Jan 2020 12:47:08 +0000 (13:47 +0100)
wcfsetup/install/files/lib/system/box/TodaysBirthdaysBoxController.class.php

index f16e0d258e564dca0c31d21923016a93a0770e16..c25cb7b6447c85ccd51814e5d4fae4aa8ea3b6d5 100644 (file)
@@ -94,7 +94,7 @@ class TodaysBirthdaysBoxController extends AbstractDatabaseObjectListBoxControll
                                        if ($userProfile === null) continue;
                                        
                                        // show a maximum of x users
-                                       if ($i == $this->box->limit) break;
+                                       if ($i == $this->limit) break;
                                        
                                        $birthdayUserOption->setUser($userProfile->getDecoratedObject());
                                        
@@ -108,11 +108,6 @@ class TodaysBirthdaysBoxController extends AbstractDatabaseObjectListBoxControll
                                        // sort users
                                        DatabaseObject::sort($visibleUserProfiles, $this->sortField, $this->sortOrder);
                                        
-                                       // apply limit
-                                       if (count($visibleUserProfiles) > $this->box->limit) {
-                                               $visibleUserProfiles = array_slice($visibleUserProfiles, 0, $this->box->limit);
-                                       }
-                                       
                                        $this->content = WCF::getTPL()->fetch($this->templateName, 'wcf', [
                                                'birthdayUserProfiles' => $visibleUserProfiles
                                        ], true);