From 953b2d3b0578c0901543b1bf31b7719e289199b2 Mon Sep 17 00:00:00 2001 From: Alexander Bias Date: Sun, 31 Mar 2024 21:03:20 +0200 Subject: [PATCH] Bugfix: In smart menus, the search for cohorts in restrict visibility by cohorts didn't work for more than 25 cohorts, resolves #462. --- CHANGES.md | 1 + classes/form/smartmenu_edit_form.php | 2 +- classes/form/smartmenu_item_edit_form.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8204cc3ae1f..b5c559eb644 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2024-04-01 - Bugfix: In smart menus, the search for cohorts in restrict visibility by cohorts didn't work for more than 25 cohorts, resolves #462. * 2024-04-01 - Improvement: Enhance the activitynavigation setting description to cover section navigation as well, resolves #536. * 2024-03-30 - Bugfix: Smart menu divider did not work for user menu submenus, resolves #537. * 2024-03-25 - Upgrade: Boost Union settings were moved to an admin settings category of its own to support the new theme chooser on Moodle 4.4, resolves #482. diff --git a/classes/form/smartmenu_edit_form.php b/classes/form/smartmenu_edit_form.php index 33abae86f83..58cc884a133 100644 --- a/classes/form/smartmenu_edit_form.php +++ b/classes/form/smartmenu_edit_form.php @@ -215,7 +215,7 @@ public function definition() { } // Add by cohorts as autocomplete element. - $cohortslist = \cohort_get_all_cohorts(); + $cohortslist = \cohort_get_all_cohorts(0, 0); $cohortoptions = $cohortslist['cohorts']; if ($cohortoptions) { array_walk($cohortoptions, function(&$value) { diff --git a/classes/form/smartmenu_item_edit_form.php b/classes/form/smartmenu_item_edit_form.php index 60ee5e94283..cfe0083258c 100644 --- a/classes/form/smartmenu_item_edit_form.php +++ b/classes/form/smartmenu_item_edit_form.php @@ -385,7 +385,7 @@ public function definition() { } // Add by cohorts as autocomplete element. - $cohortslist = \cohort_get_all_cohorts(); + $cohortslist = \cohort_get_all_cohorts(0, 0); $cohortoptions = $cohortslist['cohorts']; if ($cohortoptions) { array_walk($cohortoptions, function(&$value) {