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.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | menu_items-not-rendering-without-li-2850941-07.patch | 807 bytes | coufu |
| #4 | menu_items-not-rendering-without-li-2850941.patch | 927 bytes | codesquatch |
| #3 | 2850941-output-12182017.png | 316.86 KB | katannshaw |
| #3 | 2850941-workaround-12182017.png | 154.79 KB | katannshaw |
| #3 | 2850941-before-12182017.png | 55.61 KB | katannshaw |
Comments
Comment #2
costellofax commentedComment #3
katannshaw commented@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.

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.

Here's a screenshot of the output:

@donutdan4114 and other maintainers: Can you please look into this bug? Thanks.
Kat
Comment #4
codesquatch commentedI 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.
Comment #5
katannshaw commented@sasquatch_codes: I tested out your #4 patch and it works great! Thanks! I hope that others can test it as well.
Kat
Comment #6
katannshaw commented@Bonify: Is there any plan in the near future to commit this patch? It's really needed.
Comment #7
coufu commentedThis is patch #4 but with the correct directory (and also against 1.x-dev)
Comment #9
kala4ek#7 committed