Certain modules (like panels) print theme('page') directly to the output rather than returning it in the page callback function. This screws up popups pretty bad since it depends on menu_execute_active_handler() returning something useful. Also this output is essentially prepended to the json that is returned to the browser from popups_render_as_json().

This patch does a couple of things to clean up these related issues.

  1. The call to menu_execute_active_handler() is buffered so that if modules print from the page callback, it does not get sent to the browser.
  2. In popups_preprocess_page(), if the page_override session variable is set, then we populate a special region, 'popups_content', with the $content variable passed to theme('page'). This gives us a clean content section, regardless of how theme('page') is invoked.
  3. When $content is null, $content then gets the contents of the special 'popups_content' region that was populated in popups_preprocess_page().
CommentFileSizeAuthor
popups.theme_page.patch1.88 KBzroger

Comments

robertdouglass’s picture

Was bitten by this as well.