Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I don't know if I'm doing anything wrong or if I need to load something additionally (ahah.js?) when I add the popups but I can't for the life of me get #ahah components of a form to function if they're in a popup from the popup api.
They work fine when the page is accessed directly (not via a popup) just when I use popup's they no longer function.
Is this because of a similar issue to the WYSIWYG issue?
Fantastic otherwise :)
Comments
Comment #1
virtualdrupal CreditAttribution: virtualdrupal commentedI don't think this issue has been addressed yet by the maintainer, but here's one more vote to make it a priority...
Comment #2
nhck CreditAttribution: nhck commentedThis is an issue for me as well - I tried some things, but couldn't get it to work.
Also note that #ahah is part of the forms api:
http://api.drupal.org/api/file/developer/topics/forms_api_reference.html...
Comment #3
georgir CreditAttribution: georgir commentedThe reason it isn't working is because the ahah behavior requires some settings in the Drupal.settings.ahah javascript variable. The popups module shows only the content of the page and not its scripts and settings that were added with drupal_add_js.
A little too complex to solve for the general case, so I use the following snippet specifically for ahah settings, added to the top of the popups_render_as_json function
Make sure you also have misc/ahah.js in the additionalJavascript array in your hook_popups in case your main page doesn't always include it.
Comment #4
Ericmaster CreditAttribution: Ericmaster commentedI tried this with no luck, I'm also loading mis/ahah.js on every request, any other suggestion? are there any specific popup options I need to set?
Comment #5
adavis.co.uk CreditAttribution: adavis.co.uk commentedI also had this problem but solved it by hacking the source of function theme_popup_ahah_placeholder() in popup_module.php. The line
'<a href="/ahah/popup/' . $type . '/' . $hash . '"></a>' .
references /ahah/popup/etc using an absolute path, which won't work if your site is running in a sub folder like mine was so I changed it to
'<a href="'.base_path().'/ahah/popup/' . $type . '/' . $hash . '"></a>' .
And it worked fine.