From 76396c9beddc02a0451717d0102c883b8ab4ded2 Mon Sep 17 00:00:00 2001 From: Eileen Date: Fri, 3 Jan 2014 15:59:35 +1300 Subject: [PATCH] CRM-12464 - test-fixes Update DAO to generate campaign entities @colemanw , @totten - this fixes the test but highlights an issue in the commit - the addition of the condition to the pseudoconstant means it will refuse to import historical surveys ---------------------------------------- * CRM-12464: Add PseudoConstants to Schema Metadata http://issues.civicrm.org/jira/browse/CRM-12464 --- CRM/Core/DAO.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 25c72ac8c6..fbd2f6c468 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -1295,6 +1295,10 @@ SELECT contact_id //skip the FK if it is not required // if it's contact id we should create even if not required // we'll have a go @ fetching first though + // we WILL create campaigns though for so tests with a campaign pseudoconstant will complete + if($FKClassName === 'CRM_Campaign_DAO_Campaign' && $daoName != $FKClassName) { + $required = TRUE; + } if (!$required && $dbName != 'contact_id') { $fkDAO = new $FKClassName; if($fkDAO->find(TRUE)){ @@ -1348,7 +1352,12 @@ SELECT contact_id case CRM_Utils_Type::T_DATE: case CRM_Utils_Type::T_TIMESTAMP: + case CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME: $object->$dbName = '19700101'; + if($dbName == 'end_date') { + // put this in the future + $object->$dbName = '20200101'; + } break; case CRM_Utils_Type::T_TIME: -- 2.25.1