If i have a ajax call with commands
settings
insert prepend head
modal_dismiss
set_new_status
it will stop handling commans after "insert".
I debug it trugh:
When i do in misc/ajax.js Drupal.ajax.prototype.success
for (var i in response) {
console.log(response[i]['command']);
When i do the same action twice.
on first time i have:
settings
insert prepend head
--> will not called: modal_dismiss
--> will not called: set_new_status
On second time:
settings
modal_dismiss
set_new_status
The json:
[{"command":"settings","settings":{"basePath":"\/","pathPrefix":"de\/","ajaxPageState":{"theme":"educa","theme_token":"HFvxr4OqIfvDdx3Ux7wc5RvX3VHPE1b2uV--mUTAwYA","css":[],"js":{"misc\/ui\/jquery.ui.core.min.js":1,"misc\/jquery.ba-bbq.js":1,"modules\/overlay\/overlay-parent.js":1,"sites\/all\/themes\/educa\/js\/main.js":1}},"dsb_client":{"urls":{"dsb_client_file":"\/de\/dsb_client_file","dsb_client_file_preview":"\/de\/dsb_client_file_preview","dsb_client_vcard":"\/de\/dsb_client_vcard","dsb_clinet_overview":"\/de\/dsb"}},"overlay":{"paths":{"admin":"node\/*\/edit\nnode\/*\/delete\nnode\/*\/revisions\nnode\/*\/revisions\/*\/revert\nnode\/*\/revisions\/*\/delete\nnode\/add\nnode\/add\/*\noverlay\/dismiss-message\nuser\/*\/shortcuts\nadmin\nadmin\/*\nbatch\ntaxonomy\/term\/*\/edit\nnode\/*\/translate\nuser\/*\/cancel\nuser\/*\/edit\nuser\/*\/edit\/*\ntaxonomy\/*\/translate\ntaxonomy\/*\/translate\/*","non_admin":"admin\/structure\/block\/demo\/*\nadmin\/reports\/status\/php"},"ajaxCallback":"overlay-ajax"}},"merge":true},{"command":"insert","method":"prepend","selector":"head","data":"\u003cscript type=\"text\/javascript\" src=\"http:\/\/dsb-client-hh.ubuntu\/misc\/ui\/jquery.ui.core.min.js?v=1.8.7\"\u003e\u003c\/script\u003e\n\u003cscript type=\"text\/javascript\" src=\"http:\/\/dsb-client-hh.ubuntu\/misc\/jquery.ba-bbq.js?v=1.2.1\"\u003e\u003c\/script\u003e\n\u003cscript type=\"text\/javascript\" src=\"http:\/\/dsb-client-hh.ubuntu\/modules\/overlay\/overlay-parent.js?v=1.0\"\u003e\u003c\/script\u003e\n\u003cscript type=\"text\/javascript\" src=\"http:\/\/dsb-client-hh.ubuntu\/sites\/all\/themes\/educa\/js\/main.js?lppyev\"\u003e\u003c\/script\u003e\n","settings":null},{"command":"modal_dismiss"},{"command":"set_new_status","status":"draft","status_human":"Entwurf","traffik_light":"\u003cspan class=\"publish_status publish_status_orange\" title='Status is \"draft\", the resource is assigned to an editor, it was never published.'\u003e\u0026nbsp;\u003c\/span\u003e"}]
To visualize it use: http://json.parser.online.fr/
It is none of the loadet prependet js files:
misc/ui/jquery.ui.core.min.js
misc/jquery.ba-bbq.js
modules/overlay/overlay-parent.js
sites/all/themes/educa/js/main.js
Then when i return in function ajax_render()
an empty "data" for insert prepend head through ajax_command_prepend('head', $scripts_header);
I have still the same problem.
So it seams, the command: insert prepend head breaks something.
But i dindt found where it will processed.
Comments
Comment #1
greenrover33 commentedIt seams to be processed here:
Comment #2
rfayCan you please provide a simple module that demonstrates this behavior? It's very difficult to explain something like this without a concrete test case. If you can either attach a demo module or create a sandbox module that just demonstrates this problem, it will be much appreciated.
Comment #3
greenrover33 commentedSorry, forget all this,
it was my fault.
The "insert prepend head" calls Drupal.attachBehaviors(new_content, settings);
And this one of my behaviors. Witch produce an error in this case.
Sorry again for waisting time.