Given the array

$items = array(
    array(
      'children'=>array(
        1,
        2,
        3,
        4
      ),
    ),
    array(
      'children'=>array(
        5,
        6,
        7,
      ),
    ),
  );

and theming

return theme('item_list', array('items'=>$items));

the output is doubling up

1
2
3
4

1
2
3
4

5
6
7

This happens because of missing reset of $data variable (this reset is present in default theme_item_list() implementation):

      $children = array();
      $data = ''; // <--- THIS WAS MISSING, CAUSING DATA TO BE APPENDED FOR EACH NEXT CHILD
      if (is_array($item)) {
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Leon Kessler’s picture

Status: Active » Needs review
FileSize
459 bytes

Ran into the same problem.

Here's a patch, can we get this into the next 7.3 release?