ubc-web-services / galactus

A drupal 8 version of the UBC CLF theme
MIT License
5 stars 5 forks source link

Main menu links are expanded even when their children are not accessible by current user. #59

Open darkodevubc opened 2 years ago

darkodevubc commented 2 years ago

Steps to reproduce

  1. Create a parent node and menu item
  2. Create a child node and menu item
  3. Unpubilsh the child node

Symptom Visit the site as anon Parent menu gets the dropdown button when it shouldn't, since the child is not accessible

Fix Before rendering the dropdown button in menu--main.html.twig, check for children with item.below:

`
{% if item.below %}

      {% endif %}

`

darkodevubc commented 2 years ago

I won't create a PR for this unless it's deemed worthy at the Galactus level. Until then, I've implemented this in our custom CLF theme by copying Galactus menu--main.html.twig and making the change.

occupant commented 2 years ago

Oh, nice catch. I'll get that one in there for sure.