diff --git a/classes/ColdTrick/GroupTools/Menus/FilterSortItems.php b/classes/ColdTrick/GroupTools/Menus/FilterSortItems.php index 45bdd97..a7ebb88 100644 --- a/classes/ColdTrick/GroupTools/Menus/FilterSortItems.php +++ b/classes/ColdTrick/GroupTools/Menus/FilterSortItems.php @@ -27,6 +27,15 @@ public static function registerPopularSorting(\Elgg\Event $event): ?MenuItems { /* @var $result MenuItems */ $result = $event->getValue(); + /* @var $menu_item \ElggMenuItem */ + foreach ($result as $menu_item) { + if ($menu_item->getParentName() !== 'sort:parent') { + continue; + } + + $menu_item->setHref(elgg_http_remove_url_query_element($menu_item->getHref(), 'sort')); + } + // add sorting based on relationship time_created $result[] = \ElggMenuItem::factory([ 'name' => 'popular',