Steps to reproduce

  1. Installed Drupal using the minimal profile.
  2. Enabled menu firstchild and menu ui
  3. added two links to the main navigation:
    1. Parent (first child)
    2. Child (node/add)
  4. Created menu block and added it to the header region

Result

The Parent menu item has an empty href attribute:

<nav role="navigation" aria-labelledby="block-mainnavigation-menu" id="block-mainnavigation">
   <h2>Main navigation</h2>
   <ul>
      <li>
         <a href="" data-drupal-link-system-path="<front>">Parent</a>
         <ul>
            <li>
               <a href="/node/add" data-drupal-link-system-path="node/add">Child</a>
            </li>
         </ul>
      </li>
   </ul>
</nav>

Comments

loominade created an issue. See original summary.

ayrmax’s picture

StatusFileSize
new987 bytes

Sometimes it works as expected, sometimes not. I'm not sure why, but I did not investigate it further. The Patch provided is unnecessary.

awasson’s picture

I just installed the Dev version of Menu Firstchild in a D8.3.7 site and have exactly the same issue.

I can't navigate to the link that is checked to the first child. If I manually navigate to a page within that hierarchy, I can access all of the urls correctly but if I am at the front page or any of the other menu siblings in the hierarchy I can't.

Huelfe’s picture

I got the same issue as #3 described. Still no fix? :(

Cauliflower’s picture

Priority: Normal » Major
Status: Active » Needs review
StatusFileSize
new3.8 KB

Problem is that checking $item['below'] is not ok, this is empty when eg. items are collapsed. Patch attached solves this.

vandna b’s picture

#5 great work, when I applied your patch then it is working

vandna b’s picture

Status: Needs review » Reviewed & tested by the community
plusproduit’s picture

Patch #5 worked for me.
Please commit!

teknorah’s picture

Tested as working on Drupal 8.7.5, let's get this committed, merged and released!

pingevt’s picture

So far this is working for me as well.

pingevt’s picture

Title: href remains empty » Error in parsing Children
Assigned: Unassigned » pingevt

pingevt’s picture

Status: Reviewed & tested by the community » Fixed

Thanks Cauliflower

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.