Closed (fixed)
Project:
Bootstrap
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Oct 2012 at 14:11 UTC
Updated:
15 Dec 2012 at 09:20 UTC
Error: Fatal error: [] operator not supported for strings in twitter_bootstrap/includes/modules/twitter_bootstrap_preprocess_table (line 233)
Temoprary solution works for me:
function twitter_bootstrap_preprocess_table(&$variables) {
//$variables['attributes']['class'][] = 'table';
//$variables['attributes']['class'][] = 'table-striped';
$variables['attributes']['class'] = array('table', 'table-striped');
}
May be this place needs some check, for example:
function twitter_bootstrap_preprocess_table(&$variables) {
if(!isset($variables['attributes']['class'])) {
$variables['attributes']['class'] = array('table', 'table-striped');
}
else {
$variables['attributes']['class'][] = 'table';
$variables['attributes']['class'][] = 'table-striped';
}
}
Comments
Comment #1
avr commentedHere's a little different check (I think I saw this somewhere else) that ensures any existing classes are an array and then adds Bootstrap classes:
Comment #2
andregriffin commentedComment #3
andregriffin commentedComment #4
natted commentedComment #5
frankbaele commentedcommited #1
Comment #6.0
(not verified) commentedadded path to file