Skip to content

Commit

Permalink
fixed: remove sort query element on other sorting menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalsem committed Sep 3, 2024
1 parent da87035 commit d35464d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions classes/ColdTrick/GroupTools/Menus/FilterSortItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit d35464d

Please sign in to comment.