With the latest stable and dev versions of Panels v3.4 and Page manager installed, I receive a javascript error "Cannot set property 'Layout' of undefined" when adding a page. On a clean install using simplytest.me/project/panels at admin/structure/pages/add I add a page by only inputting a title and path, on the next page the error appears.
It seems panels/js/layout.js cannot declare Drupal.Panels.Layout since Drupal.Panels has not been defined. This is because panels/js/panels-base.js has not been loaded in panels/includes/display-layout.inc.
At line 97 panels/js/layout.js is loaded, we can load panels-base.js by inserting
ctools_add_js('panels-base', 'panels');
or
$renderer = panels_get_renderer_handler('editor', $display);
$renderer->add_meta();
at the line before. (sorry I cannot make a patch)
Thanks for the great work, loving Panels big time!
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | panels_layout_undefined_js-2199391-04.patch | 369 bytes | sylus |
Comments
Comment #1
morenstratI have the same problem with panel nodes, but only when JS aggregation is turned on. I get this error on "node/[nid]/panel_layout" pages:
Error in layout.js on line 8:
With JS aggregation off, the error is gone.
Comment #2
irodriguez commentedI am experiencing the same issue as comment #1. When I turn on JS aggregation I get the same error
in layout.js. When I turn JS aggregation off then the problem is not as prominent although the error remains.
I am using Drupal 7.26, and Panels 7.x-3.4
I noticed that panels-base.js is not being loaded before layout.jsin my , should this be loading? It seems to contain the master variable/object instance Drupal.Panels.
Comment #3
irodriguez commentedI have attached a patch for this issue that will include panels-base.js within includes/display-layouts.inc adjust urls in the patch as needed. as of now the patch is applied to /sites/all/modules/panels
Comment #4
sylus commentedRan into this same problem. I rerolled into a proper patch for drush make purposes.
Patch works as mentioned in earlier post and seems reasonable so RTBC.
Comment #5
hanoiiworks!
Comment #6
socialnicheguru commentedworked for me too
Comment #7
proteo commented@sylus, #4 worked for me too, thanks!
Comment #8
anybodyWorks for me and should be patched ASAP! Sadly this thread is already 5 month old :(
Comment #9
csc4 commentedThis just for me.. patch seems to work
Comment #10
drurian commentedPlease, commit, it's just one line.
Comment #11
mkhamash commentedRTBC+
Comment #12
japerryheh I've ran into this issue too. Works now, Fixed!