diff --git a/VERSIONS_HOTLINE/55376 b/VERSIONS_HOTLINE/55376 new file mode 100644 index 0000000000000000000000000000000000000000..274a083a99f731ed94a7765f6fef3c6411c5e88d --- /dev/null +++ b/VERSIONS_HOTLINE/55376 @@ -0,0 +1 @@ + - ticket #55376 : Administration : optimisation du temps d'affichage des destinataires des newsletters \ No newline at end of file diff --git a/library/Class/Migration/NewsletterSubscriptionMigration.php b/library/Class/Migration/NewsletterSubscriptionMigration.php index b53bcb5ea83c0647b79c215876dd869c64d59212..a507d27d21b3818db880520af234b2a44cd22df3 100644 --- a/library/Class/Migration/NewsletterSubscriptionMigration.php +++ b/library/Class/Migration/NewsletterSubscriptionMigration.php @@ -79,7 +79,12 @@ class Class_Migration_NewsletterSubscriptionMigration { if ($newsletter->getAutoSubscribe() && $user->isAbonne()) continue; - $newsletter->subscribeToDedicatedGroup($user); + $group = $newsletter->getDedicatedGroup(); + + $attribs = ['user_id' => $user->getId(), + 'user_group_id' => $group->getId()]; + if (!Class_UserGroupMembership::findFirstBy($attribs)) + Class_UserGroupMembership::newInstance($attribs)->save(); } } } \ No newline at end of file diff --git a/library/Class/UserGroup.php b/library/Class/UserGroup.php index e11a0c4349cd5e4e04ec65a24b4f9e53e63b6e46..f0e3a6ce29e3dcaa2522b68977364f591f7f27ea 100644 --- a/library/Class/UserGroup.php +++ b/library/Class/UserGroup.php @@ -286,7 +286,7 @@ class Class_UserGroup extends Storm_Model_Abstract { public function hasUser($user) { if ($this->isManual()) - return in_array($user->getId(), $this->getUsersIds()); + return in_array($user->getId(), $this->getUsersIdsOptimized()); if ($user->getRoleLevel() != $this->getRoleLevel()) return false; diff --git a/library/storm b/library/storm index 57fb2c7f9ae96f2cb825484e4576619ffa2d91e7..253f43f3a244fcab21498448f93b0bba7aa54ce5 160000 --- a/library/storm +++ b/library/storm @@ -1 +1 @@ -Subproject commit 57fb2c7f9ae96f2cb825484e4576619ffa2d91e7 +Subproject commit 253f43f3a244fcab21498448f93b0bba7aa54ce5