Problem/Motivation

Custom modules that implements the hook_quicktabs_tabstyles() and have a space in their name create invalid and useless CSS classes.

Example: How to repeat

function myproject_styles_quicktabs_tabstyles() {
  $tabstyles_directory = drupal_get_path('module', 'myproject_styles') . '/tabstyles';
  return array($tabstyles_directory . '/myproject-blue.css' => t('My Project Blue'));
}

The HTML output from quicktabs creates an invalid classname for this style: "quicktabs-style-my project blue".

<div id="quicktabs-myproject_test" class="quicktabs-wrapper quicktabs-style-my project blue jquery-once-1-processed">
  <div class="item-list">
    <ul class="quicktabs-tabs quicktabs-style-my project blue">...</ul>
  </div>
  <div id="quicktabs-container-myproject_test" class="quicktabs_main quicktabs-style-my project blue">...</div>
</div>

Proposed resolution

Instead of using drupal_strtolower() to create the class name, use drupal_html_class().

...Patch provided in first comment.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jwilson3’s picture

jwilson3’s picture

Status: Active » Needs review
FileSize
1.73 KB

Rerolled. I missed one instance of the invalid classname. should be applicable with git apply now.

ezra-g’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Clarify problem statement section.