Closed (fixed)
Project:
Panels
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Mar 2012 at 08:43 UTC
Updated:
16 Jun 2014 at 16:29 UTC
Jump to comment: Most recent
Currently the caching of inline js like following:
drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });', 'inline');
drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });',
array('type' => 'inline', 'scope' => 'footer', 'weight' => 5)
);
leads to notices like this:
Warning: Invalid argument supplied for foreach() in drupal_array_merge_deep_array() (Line 2045 of drupal/includes/bootstrap.inc).
Inline JS is added to the js array using numeric indexes starting at 0.
Unfortunately the condition if ($key != 'settings') { in panels_cache_object::restore() interprets 0 as 'setting'.
Changing the code to if ($key !== 'settings') { fixes that.
| Comment | File | Size | Author |
|---|---|---|---|
| panels-panels_cache_object-inline-js-fix.patch | 418 bytes | das-peter |
Comments
Comment #1
dawehnerSome code which works on views
Comment #2
merlinofchaos commentedCommitted based on on dereine's RTBC.