When you attempt to click the "Change layout" button in Panels IPE, a little spinner comes up for a second and then both the "Customize this page" and "Change layout" buttons disappear, and only reappear if you reload the browser.

In Chrome Dev Tools console, the error is:

Uncaught TypeError: Object [object Object] has no method 'once'
Drupal.behaviors.CToolsDependent.attach
Drupal.attachBehaviors drupal.js:55
e.extend.each jquery.min.js:2
Drupal.attachBehaviors drupal.js:53
Drupal.ajax.commands.insert ajax.js:542
Drupal.ajax.success ajax.js:400
Drupal.ajax.ajax.options.success ajax.js:164
f.Callbacks.n jquery.min.js:2
f.Callbacks.o.fireWith jquery.min.js:2
w jquery.min.js:4
f.support.ajax.f.ajaxTransport.send.d jquery.min.js:4

I searched the Panels queue and found http://drupal.org/node/1337806#comment-5568226 ... The problem seems to be jQuery 1.7 so I bet this is going to be "fun" to fix. :\

Comments

webchick’s picture

Gábor Hojtsy’s picture

Yeah it's down to jquery_update that @jessebeach wanted to include to make use of new jQuery features. I tried to track this down but could not figure out immediately, thought @jessebeach could track this down much more quickly.

webchick’s picture

Assigned: Gábor Hojtsy » jessebeach

Let's do this then. :D

jessebeach’s picture

Assigned: jessebeach » Gábor Hojtsy

I can reproduced this issue. Digging into it now.

Gábor Hojtsy’s picture

Assigned: Gábor Hojtsy » jessebeach

Fix assignment.

jessebeach’s picture

Assigned: jessebeach » Gábor Hojtsy

The Spark distro loads jQuery 1.7.1 On the page with the error, the jQuery version is 1.7.2. Something is loading its own version of jQuery and blowing away the global jQuery object that should be there.

....

hmmm, something is loading require.js and that's calling in 1.7.2, but it should not trample on the global jQuery object. mysteries

...

It's the aloha editor. If I disable the aloha editor, the Panels IPE works just fine. Looking into how we can resolve this conflict between the modules.

webchick’s picture

Assigned: Gábor Hojtsy » jessebeach
Status: Active » Fixed

Ok, Wim was able to commit a workaround at http://drupalcode.org/project/edit.git/commitdiff/80dee37be55716c83d6530... which seems to have resolved the problem.

I'm going to mark this fixed, although Jesse said she might have a more robust solution, so it might get re-opened.

jessebeach’s picture

My more robust solution involves hacking the jQuery file that Aloha includes in their build. Essentially this problem comes down to who controls window.jQuery when. When Aloha loads, it loads a jQuery file that assigns its build of the jQuery object to window.jQuery. If Aloha loads first, it loads its own jQuery version and assigns this object by value to the window.Aloha.settings.jQuery property for use later, then Drupal's build starts, loads its version of jQuery and everything proceeds fine (this is Wim's fix). If Aloha loads any time after Drupal has loaded jQuery, the window.jQuery property is overwritten, so plugins that have been added to it, like once(), are blown away and we get the error detailed in this issue.

The real solution is that no part of the application rely on window.jQuery and this might be the case in Drupal 8, but for the moment, I concede that Wim's solution is the best one and we should go with it.

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