This line of code:
$variables['questions_list'] = theme('item_list', array('items' => $questions, 'title' => NULL, 'type' => $list_style, 'attributes' => array("class" => "faq-ul-questions-top")));
Needs to be changed to this:
$variables['questions_list'] = theme('item_list', array('items' => $questions, 'title' => NULL, 'type' => $list_style, 'attributes' => array("class" => array("faq-ul-questions-top"))));
In D7, class attributes always need to be passed as an array, not a string. By passing a string, it causes errors when trying to render the attributes, as classes are expected to be an array, not a string. In my case, I've overridden theme_item_list(), and I'm adding another class to the item list as follows:
$attributes['class'][] = 'item-list';
However, since the FAQ module has pass the class as a string, trying to use the above code results in the error that I've provided in the title.
Comments
Comment #1
jaypanAlso, as a side note, it would be nice if you changed the double quotes to single quotes, to be consistent with the rest of the line of code.
Comment #2
jaypanBump
Comment #4
sudev.pradhan commentedAdded in the fixes mentioned by jaypan. Closing this as issue is now resolved.