If a menu item doesn't have the "Enable fields for this menu link" checkbox checked, the menu item renders as a naked a tag without the li wrapper. This results in invalid HTML.

Comments

costellofax created an issue. See original summary.

costellofax’s picture

Issue summary: View changes
katannshaw’s picture

StatusFileSize
new55.61 KB
new154.79 KB
new316.86 KB

@costellofax: I'm having the exact same issue. I've installed Menu Item Fields v 7.x-1.0-alpha2 on a site running Drupal 7.56 and this is the result after adding an image menu item.
Before

I used your workaround by selecting the "Enable fields for this menu link" checkbox for every first-level menu item that doesn't use an image and this is the result.
Workaround

Here's a screenshot of the output:
Output

@donutdan4114 and other maintainers: Can you please look into this bug? Thanks.

Kat

codesquatch’s picture

I found where the issue is happening at in menu_fields.module. I've attached a patch that resolves the issue by checking if the menu_link item is selected to render it's menu fields.

katannshaw’s picture

@sasquatch_codes: I tested out your #4 patch and it works great! Thanks! I hope that others can test it as well.

Kat

katannshaw’s picture

@Bonify: Is there any plan in the near future to commit this patch? It's really needed.

coufu’s picture

This is patch #4 but with the correct directory (and also against 1.x-dev)

  • kala4ek committed eb8535f on 7.x-1.x authored by Coufu
    Issue #2850941 by codesquatch, Coufu, jayhawkfan75, costellofax: Menu...
kala4ek’s picture

Status: Active » Fixed

#7 committed

Status: Fixed » Closed (fixed)

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