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.
Related we're getting the following errors in watchdog:
Warning: Invalid argument supplied for foreach() in include() (line 28 of sites/all/modules/panels/templates/panels-add-content-modal.tpl.php).
Notice: Undefined variable: columns in include() (line 28 of sites/all/modules/panels/templates/panels-add-content-modal.tpl.php).
Doing some investigation...
Comment | File | Size | Author |
---|---|---|---|
#8 | 1708230-fix-ajax-callback.patch | 1.79 KB | Dave Reid |
#7 | 1708230-fix-ajax-callback.patch | 1.26 KB | Dave Reid |
Comments
Comment #1
Dave ReidHere's the the full export of $variables after template_process_panels_add_content_modal() has run: https://gist.github.com/b94af0642fb40614e3e9. Even if I add $vars['columns'] = array() to the begginning of template_process_panels_add_content_modal() we still get the AJAX error.
Comment #2
Dave ReidWell I'm at a loss here. :/
Comment #3
xeniak CreditAttribution: xeniak commentedI'm having the same problem.
Comment #4
Dave ReidSo after some more debugging it appears that the XHProf module doesn't disable it's output on ajax callbacks.
Comment #5
Dave ReidSeems that this problem resides in Panels. Other page callbacks that use 'ajax_deliver' as the 'deliver callback' in their respective hook_menu() such as file/ajax do not have XHProf output in their JSON output.
Comment #6
Dave ReidConfirmed that a Panel AJAX response does not return the correct Content-Type header for JSON content (
application/json; charset=utf-8
) and therefore confuses modules like XHProf when it returns the incorrect Content-Type header of text/html.Comment #7
Dave ReidPatch against 7.x-3.2. Let's see if it applies against 7.x-3.x.
Comment #8
Dave Reidpanels_ajax_theme_callback() is unnecessary now too.
Comment #9
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted and pushed.
It's worth noting that CTools probably also suffers from this problem, with a great deal of ajax_render() calls of its own.
Comment #10
merlinofchaos CreditAttribution: merlinofchaos commentedCreated a CTools issue: #1710710: ajax_render should not be used; ajax_deliver should be used instead.