CRM_Core_DAO::assignTestFK() - Fix FK checks on BAOs
authorTim Otten <totten@civicrm.org>
Tue, 6 Jan 2015 19:25:41 +0000 (11:25 -0800)
committerTim Otten <totten@civicrm.org>
Wed, 7 Jan 2015 01:07:01 +0000 (17:07 -0800)
CRM/Core/DAO.php

index ad7a213312adbb0fb867fe2071ceaf2f517deff2..7b49a19fb2d9893023e8172c0f90e908a47f8d57 100644 (file)
@@ -121,7 +121,7 @@ class CRM_Core_DAO extends DB_DataObject {
     $required = CRM_Utils_Array::value('required', $fieldDef);
     $FKClassName = CRM_Utils_Array::value('FKClassName', $fieldDef);
     $dbName = $fieldDef['name'];
-    $daoName = get_class($this);
+    $daoName = str_replace('_BAO_', '_DAO_', get_class($this));
 
     // skip the FK if it is not required
     // if it's contact id we should create even if not required