Index: libraries.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/libraries/libraries.module,v retrieving revision 1.16 diff -u -p -r1.16 libraries.module --- libraries.module 15 Dec 2010 21:09:52 -0000 1.16 +++ libraries.module 11 Jan 2011 18:45:01 -0000 @@ -414,26 +414,13 @@ function libraries_load_files($library) // @see drupal_process_attached() foreach (array('js', 'css') as $type) { if (!empty($library['files'][$type])) { - foreach ($library['files'][$type] as $data => $options) { - // If the value is not an array, it's a filename and passed as first - // (and only) argument. - if (!is_array($options)) { - // Prepend the library path to the file name. - $data = "$path/$options"; - $options = NULL; - } - // In some cases, the first parameter ($data) is an array. Arrays can't - // be passed as keys in PHP, so we have to get $data from the value - // array. - if (is_numeric($data)) { - $data = $options['data']; - unset($options['data']); - } + foreach ($library['files'][$type] as $file => $options) { + $filepath = "$path/$file"; // Apply the default group if the group isn't explicitly given. if (!isset($options['group'])) { $options['group'] = ($type == 'js') ? JS_DEFAULT : CSS_DEFAULT; } - call_user_func('drupal_add_' . $type, $data, $options); + call_user_func('drupal_add_' . $type, $filepath, $options); $count++; } }