Needs review
Project:
AHAH helper
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 May 2010 at 09:44 UTC
Updated:
22 Dec 2011 at 21:58 UTC
Jump to comment: Most recent file
Comments
Comment #1
tayzlor commentedafter some further testing, the above patch breaks modal dialog functionality if an ahah form is rendered in a ctools modal. What will happen is that the modal will load if you click a link on a page first time round, then if you click on an ahah behaviour, close the modal, then try to re-open it by clicking the link, the javascript will not fire and the page will redirect to the nojs page.
Comment #2
tayzlor commentedrelated post - http://drupal.org/node/244025#comment-2546764 , which explains my patch, but the patch seems to break the modal stuff as explained above. any ideas?
Comment #3
cristhian commentedPatch seem to be correct, getting new js is missing.
About the ctools modal, have you tried commenting ahah_helper.js? I had a similar behaviour, but only when a form input realoaded itself with ahah_helper. I noticed for some reason in ahah_helper.js it breaked before Drupal.attachBehaviors, so ahah stopped working. Then I commented all in that file and got no problem, at this point I'm not sure what's the difference between leaving it or not.
Comment #4
tayzlor commented@Cristhian
commenting out that file makes no difference - the call to drupal_get_js() causes problems with other scripts on the page.
After a bit of further investigation it seems the main problem is because the settings for the AHAH added date_popup field are not passed out through the ahah_helper_render() function.
The new javascript files which are called by calling date_popup_load() and through date_popup_js_settings_id() are also not added.
Could the new JS files be loaded by integrating with the ajax load module, by implementing the _alter() hook before the data is rendered out in JSON?
I am attaching a patch to cover adding the date popup settings back to the form through the ahah render function.
To ensure the date popup will work the js will need to be on the page when the page is loaded, which you can achieve by doing -
Comment #5
Alun commentedsubscribe. Many thanks for working on this bug - its an issue for my module.
Comment #6
FranciscoLuz commented@tayzlor #4
Thank you, this is the best solution I have found on this issue.
Comment #7
shekar.kyatam commentedAdd to this to js:
$(function() {
$(document).ajaxComplete(function()
{
$("#edit-cheque-date").datepicker({
changeMonth: true,
changeYear: true,
yearRange: '1970:2020',
dateFormat: 'dd-mm-yy'
});
});
}
Comment #8
adamdicarlo commentedHere's the patch from #4 rerolled from head and in git format. Also with whitespace errors fixed and capitalization/punctuation in first comment fixed.