Closed (fixed)
Project:
Node.js integration
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Jul 2012 at 00:17 UTC
Updated:
13 Dec 2015 at 19:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Letharion commentedClearly this doesn't happen to everyone. You need to show how others can reproduce the problem.
Comment #2
esmerel commentedComment #3
socialnicheguru commentedthis is an interaction with nodejs and I'm trying to investigate
Comment #4
socialnicheguru commentedEnable panels_ipe
Enable for specific content type
Create a node and click save
Two buttons will appear: "Customize this page" and "Change this layout"
When I click on either one of these without nodejs enabled, all is good in the world. The page layout and/or content can be changed in line.
Now I enable nodejs and configure it correctly for the same site.
When I goto the above node and click either of the buttons I get the error:
An error occurred while attempting to process /panels/ajax/ipe/save_form/panelizer%3Anode%3A9%3Apage_manager: this.ipeReplacedBeforeSerialize is not a function
There is some type of conflict between nodejs and panels_ipe.
(On another note: the url for the error looks odd. '%3A' which I assume is ascii for '/' is only added after the panelizer portion)
Comment #5
socialnicheguru commentedmoving to nodejs queue since disabling nodejs causes the error to go away.
similar issue:
https://drupal.org/node/2056891
Comment #6
socialnicheguru commentedupdate title
Comment #7
hatsch commentedi can confirm this issue. since i've installed nodejs IPE stopped working.
Comment #8
Anonymous (not verified) commentedNode.js monkey-patches Drupal.ajax:
http://drupalcode.org/project/nodejs.git/blob/refs/heads/7.x-1.x:/nodejs...
i guess that causes issues? NFI why.
can someone point me at the js code in panels_ipe that breaks?
Comment #9
cmonnow commentedHi,
I assume the conflicting code in panels_ipe is the following in panels_ipe/js/panels_ipe.js?
Based upon javascript console results:
panels_ipe's
Drupal.ajax.prototype.ipeReplacedBeforeSerializereferences the original ajax function first (before the nodejs.js override).Then nodejs.js's
Drupal.Nodejs.originalBeforeSerializereferences the already over-writtenDrupal.ajax.prototype.beforeSerialize, before over-writing it once again with its own code that happens to reference the over-written fake original from panels_ipe that contained this.ipeReplacedBeforeSerialize.Should panels_ipe.js simply be returning
Drupal.ajax.prototype.ipeReplacedBeforeSerialize(element_settings, options)instead?Cheers
Comment #10
socialnicheguru commentedComment #11
Anonymous (not verified) commentedthanks for digging in.
i'm not sure what the right answer is, i'm not really familiar with this js pattern. i'll ask some people who should know.
Comment #12
socialnicheguru commentedThe tweak in #9 did not work for me.
Comment #13
cmonnow commentedThat's a shame. I'm using Panel 7.x-3.3 as part of some old Panopoly distro. Admittedly, I haven't tried saving anything (and I'm afraid to try - since I don't use IPE anyway) but the error has disappeared in my case and the customize and change layout buttons appear to work normally.
Comment #14
socialnicheguru commentedI tried #13 and it seems to work.
Comment #15
Anonymous (not verified) commentedok, closing based on #14.
Comment #16
mike.darke commentedI've just come across this same issue. I tried updating as per #13 and while this fixed the issue which prevented the panels dialog from opening there still remains a problem where updating or adding panels does not save so I am re-opening the ticket.
The issue is caused because the scope of "this" is changed by the Nodejs implementation of beforeSerialize, when Drupal.Nodejs.originalBeforeSerialize is called the scope of "this" is changed from the Drupal.ajax object to the Drupal.Nodejs object. This results in the panels_ipe saveEditing function not getting called.
To fix this I assigned the originalBeforeSerialize function to the Drupal.ajax prototype and then call it with "this" within the overridden beforeSerialize function, this is the same technique that is used by panels_ipe.js. This way the scope is maintained and the panels can be saved. Also this does not require the change in #13 to the panels_ipe.js.
Importantly, this would also potentially fix any interoperability issues with this module and any others that override the Drupal.ajax.beforeSerialize function. Here is the code I updated...
Comment #17
Anonymous (not verified) commentedthanks for the patch, i'll look at it today.
Comment #18
Anonymous (not verified) commentedComment #19
socialnicheguru commentedpath in #16 seems to work with the following version:
; Information added by Drupal.org packaging script on 2014-03-25
version = "7.x-1.7+3-dev"
Comment #21
Anonymous (not verified) commentedthanks, committed the patch in #16.
Comment #23
cmonnow commentedThe on disconnect function needs to be updated with the new name as well (a serious side effect of this bug is that if the node.js server becomes disconnected then Drupal.ajax.prototype.beforeSerialize becomes 'undefined' and all AJAX requests will subsequently fail even after reconnection).
;
should be changed to:
(Convention-wise, should I post the patch to a new thread for a "closed (fixed)" topic?).
P.S. Thanks to Firebug's profiling feature for making my debugging easier...
Comment #24
damienmckennaComment #25
socialnicheguru commentedi had to make the fix outlined in #23. works
Comment #26
cmonnow commentedCheers. I've attached #23's equivalent in patch.
Comment #27
Anonymous (not verified) commented#26 solves the issue for me. The patch applies cleanly to the latest dev.
Comment #28
Zemelia commentedHi, issue appears on latest dev version.
Error message: "Cannot read property 'sessionid' of undefined"
Patch attached.
Comment #29
Zemelia commentedComment #30
Anonymous (not verified) commentedthanks, committed and pushed to 7.x-1.x.