I upgraded to 6 3 3 this morning. Now I wanted to edit a panel:
Wanted to add more content.
The display just takes ages until it is loaded .. like 10 seconds or more. (yesterday it was smoothly - I guess under 1 second)

Then I want to add a node. Type in the first few characters, no auto-complete at all.
I use the node ID, klick on save button and after a few minutes (5 or so) I decided to cancel the transaction.
I saw the newly added node on the content tab but after clicking on update it disappeared.

Wanted to add a block, similar here .. the ajax status icon is turning and turning without any results.

I tried it several times but I can't get new content on my panel :(

What should I do now?

Bye, Transmitter


subscribing. Getting this after update. One thing I have noticed is that the background refreshes but the the icon is still going. When this happens, I know that the settings have set then I just close the window. hit update then hit save.

one more thing, on existing panels, once you move a content of a panel to another location and hit update, then save, other panels disappear on page display

Same problem here

Major screwup :(

I tried to downgrade (site into admin mode, replace panels folder with old version (3.3) and run update.php), but the ajax (existing node finder) still doesn't respond at all :(

It seems to be a problem with ctools (also security upgraded today to version 1.4) - I downgraded ctools as well - and now ajax works again.

I haven't tested the panels-3.4+ctools-1.3 combination to see if panels works with that.

This whole combination is messed up, major errors missing mini panels. No ajax no style allc crewed up. Where to go from here.

I replaced panels and ctools modules with their old contents (before upgrade) and ran upgrade.php - now panels works again. I had to delete and recreate panels created while having v3.4 installed.


Now it works.

I first only downgraded CTools which resulted in: There are no panels anyomre !?
Then I also downgraded Panels, now I'm back again where I was 8 hours ago: At a working panels installation :) *that was fun* ;)

same problem here - eternal spinning...

getting this in my log.

array_shift(): The argument should be an array in local/home/site.com/sites/all/modules/ctools/includes/context.inc on line 1071.

any luck anyone?

Priority:Normal» Critical

I am changing priority to critical. Sorry to change the status but my site is crippled now.

For now people getting this are going ot need to downgrade until we understand what is going on.

I agree that this is critical. We may need some help reproducing this -- I'm not in a position to check on this at the moment. I will attempt to tomorrow if I have some time.

Thank you Merlin!

Problem description...

1. Edit setting in a panel and save

2. Icon remains spinning and modal remains open but page behind modal updates- BUT not completely. The panel just edited is toggled open.

Firebug shows this error:
callback is undefined
Line 13

3. Edit a 2nd panel without updating/saving and the page displays the inline JS.

Firebug shows this error:
Drupal.theme.prototype[func] is undefined
Line 180

4. Hit browser back button and attempt to edit panel from step 3 and this time the modal displays correctly.

5. Repeat 1-4 to continue updating panels and content. Content saves correctly.

Panels 6.3.4
CTools 6.1.4

I have reproduced this.


Drupal 6.16
CTools 6.x-1.4
Panels 6.x-3.4
Views & Admin Menu also installed


1. Using the "Add Content" button in the top left hand of each region, attempting to add any new content to an existing mini panel, panel node, panel page.
2. Editing the settings of any panel using the "Settings" button on any panel.


a is undefined
[Break on this error] eval(function(p,a,c,k,e,r){e=function(...41.2.4 2009/07/21 08:59:10 goba Exp $


Turning off "Optimize JavaScript files" in Performance/Settings will stop the problem

Working on more info...

disabled setting no ajax hanging but still no content showing for me.

@mrgoltra - I'd say you're looking at two separate issues. Hit them one by one.

I've been looking at various reasons for javascript aggregation to break. One was referenced some time ago in an issue relating to semi-colon closes on function() {};

I've gone through each javascript file and made appropriate changes, but it still breaks under aggregation, so looking into other possibilities.

EDIT: Silly me, that was when JSMin was being played around with... something else going on here.

will do. thanks.

I think I've found what's going on.

Offending code is in ctools/js/ajax-responder.js, starting at line 396

  Drupal.CTools.AJAX.commands.scripts = function(data) {
    // Build a list of scripts already loaded:
    var scripts = {};
    $('script').each(function () {
      Drupal.CTools.AJAX.scripts[$(this).attr('src')] = $(this).attr('src');
    var html = '';
    for (i in data.argument) {
      if (!Drupal.CTools.AJAX.scripts[data.argument[i]]) {
        Drupal.CTools.AJAX.scripts[data.argument[i]] = data.argument[i];
        html += '<script type="text/javascript" src="' + data.argument[i] + '"></script>';
    if (html) {

When you add content from the panels UI, it does an AJAX post to /panels/ajax/add-pane-config/1/left/node/node/form.

That returns a JSON array with an array element "scripts", listing a series of javascript files.

In my minimal drupal install to test this issue, it returns jquery.js, drupal.js, admin_menu.js, panels.js, dropdown.js.

Your code starting at line 398 checks the new scripts against existing scripts to see if they are already included. If they aren't included, it includes them.

    $('script').each(function () {
      Drupal.CTools.AJAX.scripts[$(this).attr('src')] = $(this).attr('src');

Of course, if javascript preprocessing is turned on, looking at script.src isn't going to be useful, because there's only going to be one file listed, thus the new files are being included, and including them again causes javascript errors.

I don't know the code enough to have a rationally efficient shot at a solution, but I hope this information helps you save time doing a fix.

Turning off "Optimize JavaScript files" in Performance/Settings will stop the problem

I can confirm that turning off "Optimize JavaScript files" in Performance/Settings did indeed stop the problem on my site.

are new contents being created or nodes using panels being updated? I did this but any new contents are not being saved or created.

The code is supposed to record what scripts are on a given page by ID, and when that ID is sent back it will know not to add scripts that are already there. Clearly there is something failing with that mechanism.

Will have to investigate and see if we can figure out how this is failing.

mrgoltra, I had no problem creating new panels nodes, and adding content to them, nor did i have trouble adding new panels pages, and adding contenting to them. I also no longer have trouble editing existing nodes or pages once the optimize option is disabled. I did have to flush my caches though after changing the option.


I am having problems adding panels and nodes. It doesn't even show up on contents, but they do exist. When I try to create a panel it is telling to add a variant?

Status:Active» Needs review
new640 bytes

Ok, if you have javascript aggregation (called optimization in the UI) on, this should fix the problem. Note: after applying this patch you will need to clear cache (the performance page has a button to do this) to get the aggregated javascript on.

This is a patch to CTools, not Panels, so be sure to apply it in the right place.

Applied the patch against 1.4 and it solves some issues (flushed caches, disabled/reenabled optimization).
First and foremost I don't get those anymore #796308: Get a lot of machine language when I try to edit the settings.
Changing settings of existing panes also works however the "ajax-wheel" keeps on turning forever. So I just close it after a while and save and the change is applied. Adding content this way does not work though. I get the new pane but only until I save. Then it is lost.

When you see the JSON code in your browser, is there a corresponding javascript error? (javascript console in Firefox is ctrl-shift-J or use firebug)

Status:Needs review» Needs work

Subscribing. I can't confirm this fix in Chrome.

I do see the following JS Errors upon submitting the dialog:

Uncaught SyntaxError: Unexpected token < content:1
Uncaught TypeError: Cannot call method 'call' of undefined content:1
Uncaught TypeError: Cannot call method 'savePositions' of undefined js_23e5f0ec5f51181feb97ce88c5d43525.js:2862

Hm. That is a pure javascript syntax error. Can you look in js_23e5f0ec5f51181feb97ce88c5d43525.js (will be in files/css) and look at line 2862 and paste the 3-4 lines before and after it (and point out which one is precisely line 2862)?


   if ($(context).hasClass('panel-pane') && !$(context).hasClass('panel-portlet')) {
    // Make draggables and make sure their positions are saved.
    Drupal.Panels.Draggable.savePositions(); // <-- Line 2862
    // Bind buttons.
    $('input#panels-hide-all', context).click(Drupal.Panels.clickHideAll);
    $('input#panels-show-all', context).click(Drupal.Panels.clickShowAll);

Actually, this might just be one of my sites that is experiencing this. Three others in two different code bases are behaving correctly.

Status:Needs work» Reviewed & tested by the community

Yeah, confirmed I had a bad pane on the troublesome site and that your patch does fix the issue. Sorry for the confusion!

Status:Reviewed & tested by the community» Needs review


I've applied this patch and my environment still produces the error described in #12 and #20 when javascript aggregation is turned on.

It's still including javascript files a second time as I describe in #20

I've cleared cache etc, and checked the new code is being used by opening the aggregated javascript file and checking the change is there.


Yes, after applied this patch can edit region and pane style ...

Status:Needs review» Active


Status:Active» Needs review

Sorry, didn't mean to change the status :(

re # 29, merlinofchaos

Sorry for coming back to this so late but I am from Germany and so we have some "scheduling" problems. ;)

This is the error I did get when I wanted to edit the settings of a pane (result: screen filled with "machine-language"):

Drupal.theme.prototype[func] is undefined
Line 180

I thought that it was solved by your patch but now I am not so sure. I can reproduce this on some panes but I am not sure what the pattern is. For example editing a calendar block produces this with the error above. Editing other panes only throws this error:

a is undefined
Line 13
and this line in the console /packer/ JS compressor detected /* !eval(new String(function(p,a,c,k,e,r);)) */ "Line 13" is a really loooong line of code.

This happens when "the wheel keeps turnin'". In those cases changes are applied upon save but added panes are gone.

Edit: Clicking on "PanelsDisplayEditor()" in firebug sends me to line 4279 of js_a00ae65ed20249ff898a34d7944260f4.js

Drupal.behaviors.PanelsDisplayEditor = function(context) {
4274 // Show javascript only items.
4275 $('span#panels-js-only').css('display', 'inline');
4277 $('div.panel-pane:not(.panel-portlet)', context)
4278 .addClass('panel-portlet')
4279 .each(Drupal.Panels.bindPortlet);

Assigned:Unassigned» davidmeeks


Assigned:davidmeeks» Unassigned

Assigned:Unassigned» davidmeeks

Hi All.
I also got this problem. Turning off JS cache work as an workaround.
Earl, pls let us know what we can do to solve this critical issue. My AJAX skills are not up to notch but I have a system with this problem and are more then happy to test any patches.

Assigned:davidmeeks» Unassigned

steinmb: Did you test the patch? That's what you can do.

All: I think the patch seems to work, however, it is solving only one of the problems. Some of you are experiencing other problems that I am not experiencing. These may be related to other javascript, perhaps there are items that are not being caught.

One thing you can do to help test is to try this out with Firebug and see what additional scripts get added to the page during the process.

new179.5 KB

I may not be the best for this because I really don't "know" what I am looking at but perhaps it helps a bit or I can be guided into the right direction. Attached is a screenshot of the console displaying all scripts until it breaks when I try to add a new block into a region. I have to agree that the patch solves some issues and that digging up the other ones is the problem here. As stated before adding content did not work. I stand by this statement BUT on some occasions the content DID get added AND survived the save process. Still I don't see a pattern here...

About the "machine-language error" (see #40). I was able to find a pane which created the error when I wanted to edit its settings BUT not every time. Sometimes it just throws the "a is undefined error".

When you get this sporadically, check to see if the page has fully loaded. If your page is loading very slowly and javascript is still running, the buttons will not properly bind. It's usually very easy to tell this on the main panel content page, because when the binding happens, you will see all of the panes suddenly gain their drag & drop components. Could that be part of the problem?

dddave: Ok, that picture does help a lot. You *are* experiencing the same basic problem...that you're getting a re-load of jquery that's already on the page.

Do you see the line that says GET ... jquery.js -- that's indicative of the problem.

Now, the patch I put in should stop that. So the next thing to check is that the last POST to step2, before all the GET requests? Open that up and click on the 'post' tab. It should list all of the parameters that were sent. The most important one for this is the 'page_id' -- that should be set to an md5 hash (32 characters of what looks like garbage). Prior to the patch, that page_id would not be sent, and that was causing the problem. Can you see if you're still getting that?


Just find this bug now. I didn't work on a panel page until now (since the last update).

Patch #27 doesn"t work for me. I tried a few things to make it work without success.

The only way to make this ajax bug disappear is to turn off Optimize JavaScript files option.


Applied patch in #27.
This fixed the non-stopping Ajax call for adding a viewpane to a page.
However, it continues when trying to add a node:field element panel to a page.

Below is the console error:
Error: callback is undefined
Source File: http://anglicanfrontiers.com/sites/default/files/js/js_a6b40638ad19b2489...
Line: 692

Not able to help much with js.


Earl: I tested patch from #27 (804198-broken-ajax.patch) but it did not fix the problem. Still saw these two errors in Firebug adding a new pane to a minipanel.

Drupal.Panels.Draggable is undefined
[Break on this error] Drupal.Panels.Draggable.savePositions();

a is undefined
[Break on this error] eval(function(p,a,c,k,e,r){e=function(...41.2.4 2009/07/21 08:59:10 goba Exp $

re #48 @merlinofchaos
I guess that any last POST before the GET requests is ok and not just the one in the pic. So I played around and on every occasion where something broke the last POST did not send a page_id md5 hash. All the POST before have such an id but the last one hasn't.

What next?

re #47: I think you are right. I noticed that now I only can recreate the issue when some other action beforehand broke. After that I can create the problem.

new107.38 KB

Just for kicks attached is the console of an unpatched version.

new1.73 KB

Aha! Thanks to Michelle I was able to home in a little bit on why the patch wasn't completely working. The page ID would get overwritten but only on some content types because of other CTools settings. This patch should fix. Can I get as many testers as possible?

Remember that you need to clear both your browser cache and the .js cache.

Later tonight I will test on a dev site. any reply back.
When testing is their a best order to do this, in other words, shall I first install ctools add the patch and then update panels or vice versa?

To say it in sports announcer terms:
"Earl throws the hammer down"
"Earl with no regard for human life"

Could not break it so far. Hurray!

Status:Needs review» Needs work
new652.81 KB


Please see the attached image for screenshots of the steps required to reproduce the problem.

- The image also shows the firebug console and the expanded JSON response that is returned from the postback when you click the "Finish" button and the javascript error is thrown.

- The URL the postback goes to is trimmed in the screenshot, for your reference the full URL is http://drupal-test/panels/ajax/add-pane-config/panel_context%3Apage-test...

- I am running the patch you supplied in #27 with cache cleared etc. It does not fix this issue.

- Only turning off aggregation fixes this issue.

- Environment is a base/clean install of Drupal specifically to test this issue:

Drupal 6.16
CTools 6.x-1.4
Panels 6.x-3.4
Views & Admin Menu also installed

+ Firefox 3.6.3

It appears to me that when Javascript aggregation is turned on, the JSON returned should not contain the list of scripts that it does because the code in ctools/js/ajax-responder.js, starting at line 396, would never work as it checks against script src which will never match with aggregation turned on.

  Drupal.CTools.AJAX.commands.scripts = function(data) {
    // Build a list of scripts already loaded:
    var scripts = {};
    $('script').each(function () {
      Drupal.CTools.AJAX.scripts[$(this).attr('src')] = $(this).attr('src');
    var html = '';
    for (i in data.argument) {
      if (!Drupal.CTools.AJAX.scripts[data.argument[i]]) {
        Drupal.CTools.AJAX.scripts[data.argument[i]] = data.argument[i];
        html += '<script type="text/javascript" src="' + data.argument[i] + '"></script>';
    if (html) {

new85.49 KB


- I have applied the second patch in #55. Browser + drupal cache cleared multiple times.
- The issue is still occuring using the same steps in the attachment in #58. The same behaviour remains.
- See the attachment to this issue for a screenshot of the firebug console for this new patch. It looks the same to me, but just in case.

Update 1:

I've been trying to learn a little more about how ctools ajax works by reading the code and this thread.

It appears the page_id parameters is crucially important in these postbacks?

So just in case it helps, here's the POST params send when clicking "Finish":

  ctools_ajax 1
  js   1
  page_id page-5678ac10f6dc5797573d6e6b5713080f

Update 2:

Actually, cancel "Update 1", I can't reproduce page_id being sent. Don't know how I got that result - it was copied and pasted out of firebug... but who knows.

Indeed, page_id is in fact disappearing . Here is the post that I can reproduce, clearly with no page_id param present:

ctools_ajax 1
form_build_id form-24c68bddd9d4d2882440d4ad94672ce6
form_id ctools_node_content_type_edit_form
form_token ead4f709bb33c1d4399779f987aab02a
js 1
links 1
nid Larpo [nid: 1]
op Finish
teaser 1

Same problem with latest CTools - CTools broke other modules too.

Status:Needs work» Needs review

#60: Not helpful. If you don't have anything useful, please don't post.

#58: Are you absolutely sure that you have cleared the javascript *and* forced your browser to reload and get the new javascript? Because what was causing the page_id to disappear is documented, and after I got this patch in, I could not find a combination that made the page_id disappear again. If you're sure, then I'm going to need you to see if you can figure out under what circumstance the page_id is disappearing, as I can't reproduce another instance.

I am not ready to kick this patch back to needs work based on just one review yet.

And before you ask, yes, I specifically tried the steps you show in your image in #58.

Your best bet would be to explore the Drupal.CTools.AJAX.getPageId function -- there should be absolutely nothing that would overwrite that value once it has been set, which makes me really concerned that you somehow did not get the newest patch. Check your aggregated .js file to make sure the function matches. Go an extra step and throw a console.log() directly into the aggregated .js file, shift-refresh your browser, and watch what's happening in firebug while you do this.


I confirm the latest patch in #55 actually does rectify the problem.

My apologies, somehow I screwed up applying the patch, and the original changes were reverted.

Thus I was operating with an incomplete patch!

I only discovered this after a couple of hours inside a debugger, after I refreshed my testing environment and reapplied the patch.

@merlinofchaos Confirming that patch in #55 rectify the problem.
Great work Earl! :) Yesss!


I receive these js errors with the new patch and compression enabled

warning: file_get_contents(sites/all/libraries/extjs/adapter/adapter/ext/ext-base.js) [function.file-get-contents]: failed to open stream: No such file or directory in /home/cyberfan/htdocs/includes/common.inc on line 2412.
warning: file_get_contents(sites/all/libraries/extjs/adapter/ext-all.js) [function.file-get-contents]: failed to open stream: No such file or directory in /home/cyberfan/htdocs/includes/common.inc on line 2412.
warning: file_get_contents(sites/all/libraries/extjs/adapter/adapter/ext/ext-base.js) [function.file-get-contents]: failed to open stream: No such file or directory in /home/cyberfan/htdocs/includes/common.inc on line 2412.
warning: file_get_contents(sites/all/libraries/extjs/adapter/ext-all.js) [function.file-get-contents]: failed to open stream: No such file or directory in /home/cyberfan/htdocs/includes/common.inc on line 2412

however when I disable the js compression the errors are gone

I confirm the patch in #55 from merlin resolve the problem on my site with the latest versions from ctools and panels

Assigned:Unassigned» davidmeeks

YESSS! #55 fixes panel content addition problems. Pages/Panels works great.

#55 patch also seems to have corrected the problems on my site. I no longer have the spinning ajax indicator, nor do i encounter problems with an inability to add content when js optimization is enabled. Thank you for your work on this!

I hope someone is getting the same problem as me?

Assigned:davidmeeks» Unassigned


please stop assigning this issue. This field is only used to indicate who is working on a solution of an issue, i.e. working on a patch.

@ #70
I hope not. ;)
Quick guess: Check if during patching any permissions changed., especially of common.inc.

The thing is I only get is when using compression?

Status:Needs review» Fixed

AntiNSA: the nature of that error looks like some module is trying to include javascript that doesn't actually exist. That module is using the extfs library -- I think that is pretty much unrelated to the Panels/CTools problem. I suspect that if you reverted to an earlier version of Panels and CTools, you would still see that problem.

With several other people finding that this patch is solving the problem for them, I am committing this.

Thanks! I am happy to see the patch working in the area of the ajax panels. Ill see if I can find out more about this js file. reat work all the time merlinofchaos. You make my life better.

Patch #55 works great! Thanks :)

# 55 Patch works fine on my dev site with little test content on it. Current Drupal build 6.16 on Debian Lenny. I have not tried it on production site as we ares ticking with the rolled back version until ironed out.

patch seems to be working. will do more testing. Thanks Earl! I really appreciate it.

Title:Ajax doesn't work reliable since the updateAjax doesn't work reliable using Safari
Status:Fixed» Active

Unfortunately, I'm still having problems using the May 27th devs of Panels and Ctools.

In Safari 4.0.5. All I attempted to do was add a views pane to my panels page. I got all the way to the step where I hit finish. Finish spun endlessly, I could see the panel pop up in the UI behind me without closing the add pane dialog box. If I manually closed it and pressed "update," the content went away (in other words, my changes did not stick/save).

This was the error in safari:

TypeError: Result of expression 'K' [undefined] is not an object.

Using Firefox, there was no issue. I did not test using Chrome.

works in chrome.

Patch from #55 works very well here, thanks a lot.


It is working fine for me. Using the patched version. Working in FF, IE and Safari.

Status:Active» Fixed

@kmonty - please verify you did all the necessary browser cache clearing. At this point it seems highly unlikely that the fix for that exact problem works for everyone else, but not for you.

Status:Fixed» Active

Eh, am I stupid or is this patch not in 1.5 despite the release notes saying it is??

Status:Active» Fixed

Patch applies cleanly. This patch is NOT in 1.5!

PS: after applying the patch, the exact same issue as reported above is also resolved for me.

This patch does not work for me using FF or IE.
The same problem persists despite me rebooting the computer and emptying all browser and drupal cache.

Confirm that this patch is not in Ctools 1.5?

I already using the latest versions of Ctools and Panels.
Please help...this problem makes it impossible for me to update my site.

Version:6.x-3.4» 6.x-3.5

#812646: Problem panel with javascript aggregation

As this is a ctools issue I guess the right place is over there...(leaving at fixed because the patch FIXES the problem).

edit: Switched to the dev of ctools and everything is working well so far...

Why not release another version of Ctools that include the patch.
I have tried the patch and it still does not solve the problem....

Dev version of Ctools did solve the problem of adding a new pane.
However, when I click on "Add New Rule" under visibility settings of a pane, the following error message popped up.

Unable to complete operation. Fatal error in C:\xampp\htdocs\drupal\sites\all\modules\ctools\plugins\access\node.inc on line 224: Cannot redeclare bulk_export_perm() (previously declared in C:\xampp\htdocs\drupal\sites\all\modules\ctools\bulk_export\bulk_export.module:13)

I tried changing visibility settings and changing the pane settings, they all work fine. Only adding a new rule seems to have problem.

Please assist. A big thank you in advance...

Status:Fixed» Closed (fixed)

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