X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FForm.php;h=f26ce82e2454c8c57c75b9bdeccf001fcd214b4c;hb=20f57460897100cb2aea105c40c16ab16604033a;hp=89c88a26dcd8f6a1a04748e01b99251a84119ade;hpb=af002a7d80740dd4e6369d2ffc11e64e89784cfd;p=civicrm-core.git diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 89c88a26dc..f26ce82e24 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -296,13 +296,15 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * This function is just a wrapper, so that we can call all the hook functions + * @param bool $allowAjax - FIXME: This feels kind of hackish, ideally we would take the json-related code from this function + * and bury it deeper down in the controller */ - function mainProcess() { + function mainProcess($allowAjax = TRUE) { $this->postProcess(); $this->postProcessHook(); // Respond with JSON if in AJAX context (also support legacy value '6') - if (!empty($_REQUEST['snippet']) && in_array($_REQUEST['snippet'], array(CRM_Core_Smarty::PRINT_JSON, 6))) { + if ($allowAjax && !empty($_REQUEST['snippet']) && in_array($_REQUEST['snippet'], array(CRM_Core_Smarty::PRINT_JSON, 6))) { $this->ajaxResponse['buttonName'] = str_replace('_qf_' . $this->getAttribute('id') . '_', '', $this->controller->getButtonName()); $this->ajaxResponse['action'] = $this->_action; if (isset($this->_id) || isset($this->id)) {