[MTE-109] Navigation - wrong highlighting Created: 19/Jun/18  Updated: 26/Aug/20  Resolved: 24/Aug/20

Status: Closed
Project: Magnolia Templating Essentials
Component/s: models
Affects Version/s: 1.5
Fix Version/s: 1.5.2

Type: Bug Priority: Neutral
Reporter: Maria Fernanda Acero Assignee: Federico Grilli
Resolution: Fixed Votes: 6
Labels: maintenance, navfn, quickwin
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File example.png    
Issue Links:
causality
relation
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: Support
Sprint: Maintenance 21
Story Points: 1

 Description   

Wrong highlighting of open page.
Similar to this issue -> MGNLSTK-496

 

To test:

  1. Go to https://demoauthor.magnolia-cms.com/.magnolia/admincentral#app:pages:;
  2. Create a page "test" and 2 sub-pages: "hall" and "hallo"
  3. Open the "hallo" page in preview mode
  4. => Now both pages are highligted

I think the error is in "isOpen" method in NavigationTemplatingFunctions, more specifically the usage of "startsWith"

 

 



 Comments   
Comment by Jonathan Ayala [ 29/Jan/19 ]

jfrantzius has shared their fix to this issue in SUPPORT-9542:

@Override
  public boolean isOpen(ContentMap content, ContentMap navigationItem) throws RepositoryException {
	final String navigationNodeId = navigationItem.getJCRNode().getIdentifier();
	final Collection<Node> ancestors = NodeUtil.getAncestors(content.getJCRNode());
	for (Node ancestor : ancestors) {
	  if (ancestor.getIdentifier().equals(navigationNodeId)) {
	    return true;
	  }
	}
	return false;
  }
Generated at Mon Feb 12 07:41:34 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.