Hi all,
maybe is a well know issue but I would like to report this, ragarding the function theme_item_list()
Here is the Drupal 7 theme_item_list() function.
in particular, this is the way it manipulate the 'title' key:

if (isset($title) && $title !== '') {
    $output .= '<h3>' . $title . '</h3>';
  }

in bootstrap, however, this is the way the function bootstrap_item_list() deals with 'title', line 173 of includes/theme.inc:

if (isset($title)) {
    $output .= '<h3>' . $title . '</h3>';
  }

This way, if I set something like this:

$output = theme('item_list', array('items' => $items,
                                  'title' => '',
                                  'type'  => 'ul',
                                  'attributes' => $attributes
                                  ));

The ouptut will result in a empty <h3> tag. This problem can be fixed simply by not set the 'title' key. However it creates a bit of confusion with the usage of the global function.
I suggest to change line 173 of the bootstrap/includes/theme.inc in:
if (isset($title) && $title !== '') {

CommentFileSizeAuthor
#2 bootstrap-item-list-2040629-1.patch736 bytesTubia87
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Tubia87’s picture

Issue summary: View changes

wrong markup in the text

markhalliwell’s picture

Tubia87’s picture

Hi,
I submit here the patch.
Sorry for the delay, but this is my first patch so I have to study how to do that :)
Hope it will be useful, 'though bootstrap version 3 is out!

Tubia87’s picture

Assigned: Unassigned » Tubia87
Status: Active » Needs review
danillonunes’s picture

Status: Needs review » Reviewed & tested by the community

Patch tested and works as expected.

markhalliwell’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/includes/theme.inc
@@ -170,7 +170,7 @@ function bootstrap_item_list($variables) {
-  if (isset($title)) {
+  if (isset($title) && $title !== '') {

Can we just do a simple:
if (!empty($title)) { here instead?

markhalliwell’s picture

Issue summary: View changes

added D7 API url

markhalliwell’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

This issue has been closed while cleaning up the issue queue. This has likely already been fixed in 7.x-3.x. If it has not, please create a new issue describing the exact issue with that version. The 7.x-2.x branch currently only receives security fixes.