Whenever i save a node im getting this error.

Warning: ksort() expects parameter 1 to be array, null given in ksort() (line 3114 of .../includes/common.inc). =>

Using krumo backtrace it suggests the error comes from this module.
Particularly where it adds inline CSS for fonts loaded via AJAX.

Fonts are working but im still getting this error. Any ideas why?

here is the backtrace:

... (Array, 11 elements)
10: ksort() (Array, 1 element)
 9: drupal_group_css() (Array, 2 elements)
 8: drupal_pre_render_styles() (Array, 2 elements)
 7: drupal_render() (Array, 2 elements)
 6: fonts_com_ajax_render_alter() (Array, 2 elements)
 5: drupal_alter() (Array, 2 elements)
 4: ajax_render() (Array, 2 elements)
 3: ajax_deliver() (Array, 2 elements)
 2: drupal_deliver_page() (Array, 2 elements)
 1: menu_execute_active_handler() (Array, 2 elements)
 0: main() (Array, 2 elements)

Comments

Drave Robber’s picture

Any ideas why?

Yes, at least a guess: drupal_group_css() somewhat optimistically assumes each CSS item will have a browser settings array ($item['browsers']). This is indeed always true for CSS added via drupal_add_css() as it ensures there is at least an empty array; in case of AJAX loading, we need to ensure that ourselves at some point.

I'll get to setting up a test install and some poking tomorrow, perhaps.

Drave Robber’s picture

Component: Code (general) » Fonts.com (provider)
Status: Active » Needs review
StatusFileSize
new820 bytes

Attached patch fixes it for me (I was able to reproduce this warning only on enabling/disabling fonts however).

Test with caution as this seems almost too easy to be true.

sreynen’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. I didn't really know what I was doing when writing that AJAX alter, so it doesn't surprise me I missed something like that.

sreynen’s picture

Status: Reviewed & tested by the community » Fixed
inventlogic’s picture

This error occurs when using Display Suite and configuring the Layout of content types.
Just a note for other users.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.