Skip to content
Snippets Groups Projects
Commit 85ef2c36 authored by Claudiu Cristea's avatar Claudiu Cristea
Browse files

Merge branch 'ISAICP-9542' into 'develop'

ISAICP-9542: Disabling a menu option does not work.

See merge request digit/digit-joinup-dev!2017
parents 916cb438 b8ec18dd
No related branches found
No related tags found
1 merge request!215Release 2.3.2
......@@ -22,16 +22,25 @@ Feature:
And I fill in "Menu link title" with "Navbar test 3 external"
And I fill in "Link" with "http://example.com"
And I press "Save"
# Add a disabled child.
And I click "Add link"
And I fill in "Menu link title" with "Navbar test 1 child"
And I fill in "Link" with "http://example.com"
And I select "-- Navbar test 1" from "Parent link"
And I uncheck the box "Enabled"
And I press "Save"
Given I am an anonymous user
When I am on the homepage
Then I should see the link "Navbar test 1" in the "Navigation bar" region
And I should see the link "Navbar test 3 external" in the "Navigation bar" region
But I should not see the link "Navbar test 2 disabled" in the "Navigation bar" region
But I should not see the link "Navbar test 1 child" in the "Navigation bar" region
# Delete menu links. Remove this in ISAICP-9486.
# Note that if any failure happens above, these links aren't removed; that's
# why we use descriptive menu link titles.
And I delete the "Navbar test 1 child" "menu link"
And I delete the "Navbar test 1" "menu link"
And I delete the "Navbar test 2 disabled" "menu link"
And I delete the "Navbar test 3 external" "menu link"
......@@ -179,7 +179,7 @@ public function getOgMenuByGroup(string $menuType, string $groupId): ?OgMenuInst
* Menu links elements.
*/
protected function getMenuLinkElements(string $menu): array {
$parameters = $this->menuLinkTree->getCurrentRouteMenuTreeParameters($menu);
$parameters = $this->menuLinkTree->getCurrentRouteMenuTreeParameters($menu)->onlyEnabledLinks();
$tree = $this->menuLinkTree->load($menu, $parameters);
$manipulators = [
['callable' => 'menu.default_tree_manipulators:checkAccess'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment