Hi Merlin,
As per a brief discussion in IRC, my issue:
I recently took it upon myself to release a rewrite of Mobile Codes for D6 utilizing CTools Exportables and Export UI to do the majority of the heavy lifting, and to provide a nice UI I incorporated some AHAH elements to the form. This all worked/works fine and dandy.
However, I then decided to port said rewrite to D7, which at first was relatively easy, until of course I hit a somewhat major snag. Export UI and Drupal 7's #AJAX callback method don't really play together too nicely. I did come across something similar to this issue while working on D6, but was able to work around it. I have not yet been able to work around the issue in D7.
When using #AJAX in an Export UI form, you will receive the following error:
Call to undefined function ctools_export_get_schema() in /[path]/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php on line 977
I suspect that this is due to the way that CTools creates a dynamically generated form function.
I have also attempted to work around this issue by using the #AJAX path method, but have not yet had any luck going down that path.
Primarily I'm looking for a pointer on how you yourself would approach this conundrum, is the CTools AJAX path the correct path, and if so how so?
Cheers,
Deciphered.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1142812-export-inc-include-on-ajax.patch | 1.2 KB | merlinofchaos |
Comments
Comment #1
Deciphered CreditAttribution: Deciphered commentedTemporary solution (supplied by Merlin) was to insert the following line before line 977 of the referenced file:
ctools_include('export');
Comment #2
Deciphered CreditAttribution: Deciphered commentedAlternative fix, on the side of the module invoking the callback you can use the following:
Comment #3
amateescu CreditAttribution: amateescu commentedThe Delta module has this issue in 3.0-beta5 and 3.0-dev on the add new template form.
Comment #4
Deciphered CreditAttribution: Deciphered commentedamateescu,
I use the workaround in #2 in a few CTools/#AHAH combinations and it works perfectly for me, so I recommend cross posting the solution to the Delta module to alert them to the solution.
Cheers,
Deciphered.
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedDoes this patch fix the problem with delta module?
Comment #6
amateescu CreditAttribution: amateescu commentedYes, this patch fixes the problem in Delta.
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commentedLooks like I committed this on Monday but forgot to mark the issue fixed.