CRM-14657 - is_transactiona is inconsistent in api
authorEileen McNaughton <eileen@fuzion.co.nz>
Wed, 7 May 2014 06:30:56 +0000 (18:30 +1200)
committerEileen McNaughton <eileen@fuzion.co.nz>
Wed, 7 May 2014 06:30:56 +0000 (18:30 +1200)
api/api.php

index 959b7994f1f3d3e78eb684f82c8b186d4b0ffa5b..357561cd3734b930d35c1023087083816f4cfa75 100644 (file)
@@ -47,9 +47,10 @@ function civicrm_api($entity, $action, $params, $extra = NULL) {
     $errorScope = CRM_Core_TemporaryErrorScope::useException();
     // look up function, file, is_generic
     $apiRequest += _civicrm_api_resolve($apiRequest);
-    if (strtolower($action) == 'create' || strtolower($action) == 'delete' || strtolower($action) == 'submit') {
-      $apiRequest['is_transactional'] = 1;
-      $transaction = new CRM_Core_Transaction();
+    if ((strtolower($action) == 'create' || strtolower($action) == 'delete' || strtolower($action) == 'submit')
+      && (!isset($params['is_transactional']) || $params['is_transactional'])) {
+        $apiRequest['is_transactional'] = 1;
+        $transaction = new CRM_Core_Transaction();
     }
 
     // support multi-lingual requests