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...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Here'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.

Dave Reid’s picture

Well I'm at a loss here. :/

xeniak’s picture

I'm having the same problem.

Dave Reid’s picture

So after some more debugging it appears that the XHProf module doesn't disable it's output on ajax callbacks.

Dave Reid’s picture

Seems 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.

Dave Reid’s picture

Title: AJAX error when adding content to panel page » panels/ajax does not respond with the 'application/json' Content-Type header

Confirmed 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.

Dave Reid’s picture

Status: Active » Needs review
FileSize
1.26 KB

Patch against 7.x-3.2. Let's see if it applies against 7.x-3.x.

Dave Reid’s picture

panels_ajax_theme_callback() is unnecessary now too.

merlinofchaos’s picture

Committed 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.

merlinofchaos’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 33c439b on 7.x-3.x, 7.x-3.x-i18n, 8.x-3.x authored by Dave Reid, committed by merlinofchaos:
    Issue #1708230 by Dave Reid: Fixed panels/ajax does not respond with the...