There could be class attribute in list items, in this case menu_local_task, that has no value. So it looks like this in the result HTML:

<li class=""><a href="/taxonomy/term/566/devel">Devel</a></li>

Change the way return value is calculated in bootstrap_menu_local_task() in menu-local-task.func.php would solve this issue.

CommentFileSizeAuthor
#2 bootstrap-list-attribute-2226359.patch678 bytesburkeker
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

burkeker’s picture

Issue summary: View changes
burkeker’s picture

Attaching a patch here. Including the "class" into the condition statement so it's not printed if $classes doesn't have any value.

markhalliwell’s picture

Status: Active » Needs work

Actually, this should be handled like bootstrap_menu_link() (making sure that $element['#attributes'] exists or at the very least is an empty array):

  return '<li' . drupal_attributes($element['#attributes']) . '>' . l($link_text, $link['href'], $link['localized_options']) . "</li>\n";
burkeker’s picture

Thanks - indeed it looks like a more reasonable solution. :)

markhalliwell’s picture

Title: class attributes without value in list items » Empty menu_local_task class attribute

  • markcarver committed a7c6438 on 7.x-3.x
    Issue #2226359 by burkeker, markcarver: Empty menu_local_task class...

  • markcarver committed 95fc6f2 on 8.x-3.x
    Issue #2226359 by burkeker, markcarver: Empty menu_local_task class...
markhalliwell’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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