CRM-10693 - Ajax - Add id to std response
authorColeman Watts <coleman@civicrm.org>
Tue, 19 Nov 2013 00:31:43 +0000 (16:31 -0800)
committerColeman Watts <coleman@civicrm.org>
Tue, 19 Nov 2013 00:31:43 +0000 (16:31 -0800)
CRM/Core/Form.php

index 46f69b9d2ce0f8dfac7c0e2a6115ead4dfe898a6..a4a38ff5571ffdfe029f222f96f6ca2d2a5bc7d1 100644 (file)
@@ -274,6 +274,9 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
     if (!empty($_REQUEST['snippet']) && $_REQUEST['snippet'] == CRM_Core_Smarty::PRINT_JSON) {
       $this->ajaxResponse['buttonName'] = str_replace('_qf_' . $this->getAttribute('id') . '_', '', $this->controller->getButtonName());
       $this->ajaxResponse['action'] = $this->_action;
+      if (isset($this->_id) || isset($this->id)) {
+        $this->ajaxResponse['id'] = isset($this->id) ? $this->id : $this->_id;
+      }
       CRM_Core_Page_AJAX::returnJsonResponse($this->ajaxResponse);
     }
   }