From ea104a9af53b16befe47a5f652cf9d1ae9a4ef36 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 12 Jun 2013 21:06:40 +0000 Subject: [PATCH] Send any accumulated json responses after flushing etemplate - allows apps to use egw_json_response even when call is not an ajax call --- etemplate/inc/class.etemplate.inc.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/etemplate/inc/class.etemplate.inc.php b/etemplate/inc/class.etemplate.inc.php index e07860c515..d82510c154 100644 --- a/etemplate/inc/class.etemplate.inc.php +++ b/etemplate/inc/class.etemplate.inc.php @@ -233,6 +233,18 @@ class etemplate_new extends etemplate_widget_template '; } + ob_flush(); + + // Send any accumulated json responses - after flush to avoid sending the buffer as a response + if(egw_json_response::isJSONResponse()) + { + $response = egw_json_response::get(); + echo ''; + } common::egw_footer(); } }