Skip to content

fix: CategoryMenu is_active logic#920

Merged
aminalaee merged 1 commit intoaminalaee:mainfrom
retromechs:fix/category-is-active
May 26, 2025
Merged

fix: CategoryMenu is_active logic#920
aminalaee merged 1 commit intoaminalaee:mainfrom
retromechs:fix/category-is-active

Conversation

@retromechs
Copy link
Contributor

A previous PR (#698) introduced a bug in the CategoryMenu.is_active function, causing it to return True if any child elements were visible. This led to misleading template errors, making all categories appear active since they all contain visible children.

This update includes:

  • A fix for the CategoryMenu.
  • Adjustments to the _menu macros to ensure categories are displayed not only if they are active but also if they are visible and accessible to the current user.
  • Additional tests to prevent regression.

The `CategoryMenu.is_active` function was incorrectly returning `True` if any of the children were visible.
Copy link
Owner

@aminalaee aminalaee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR

@aminalaee aminalaee merged commit faa5001 into aminalaee:main May 26, 2025
5 checks passed
@aminalaee aminalaee mentioned this pull request Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants