CRM-13072 set domain default for UF_Match on BAO layer rather than requiring on api
authoreileen <eileen@fuzion.co.nz>
Sat, 27 Jul 2013 12:10:11 +0000 (00:10 +1200)
committereileen <eileen@fuzion.co.nz>
Sat, 27 Jul 2013 12:10:11 +0000 (00:10 +1200)
CRM/Core/BAO/UFMatch.php
api/v3/UFMatch.php

index a2a731583305ed8bff3bc48327babbdf13db6077..ce3284c1c865ed51d8ffcde744bf7aba99c95a68 100644 (file)
@@ -47,6 +47,9 @@ class CRM_Core_BAO_UFMatch extends CRM_Core_DAO_UFMatch {
   static function create($params) {
     $hook = empty($params['id']) ? 'create' : 'edit';
     CRM_Utils_Hook::pre($hook, 'UFMatch', CRM_Utils_Array::value('id', $params), $params);
+    if(empty($params['domain_id'])) {
+      $params['domain_id'] = CRM_Core_Config::domainID();
+    }
     $dao = new CRM_Core_DAO_UFMatch();
     $dao->copyValues($params);
     $dao->save();
index 5a30616bbf5b8c77afe53206451fa26a862b83eb..d13fb3546bb95c7a9642aed0aa8a2c1d0f4fe5cc 100644 (file)
@@ -77,9 +77,6 @@ function _civicrm_api3_uf_match_create_spec(&$params) {
   $params['contact_id']['api.required'] = 1;
   $params['uf_id']['api.required'] = 1;
   $params['uf_name']['api.required'] = 1;
-  // note that this should perhaps not be required but need a wrapper level approach
-  // prefera
-  $params['domain_id']['api.required'] = 1;
 }
 
 /**