continue;
}
// Pick an option value if needed
- $options = $daoName::buildOptions($dbName);
- if ($options) {
- $object->$dbName = key($options);
- continue;
+ if ($value['type'] !== CRM_Utils_Type::T_BOOL) {
+ $options = $daoName::buildOptions($dbName, 'create');
+ if ($options) {
+ $object->$dbName = key($options);
+ continue;
+ }
}
switch ($value['type']) {
break;
case CRM_Utils_Type::T_BOOL:
- case CRM_Utils_Type::T_BOOLEAN:
if (isset($value['default'])) {
$object->$dbName = $value['default'];
}
unset($config->userPermissionClass->permissions);
}
/**
- * Function just tests that an empty where hook returns the 2 expected results
+ * Function tests that an empty where hook returns no results
*/
function testContactGetNoResultsHook(){
$this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookNoResults'));
$this->assertEquals(2, $result['count']);
}
/**
- * Function just tests that an empty where hook returns the 2 expected results
+ * Function tests that deleted contacts are not returned
*/
function testContactGetPermissionHookNoDeleted(){
- $this->callAPISuccess('contact', 'create', array('id' => 2, 'is_deleted' => 1));
+ $result = $this->callAPISuccess('contact', 'create', array('id' => 2, 'is_deleted' => 1));print "\n";print_r($result);
$this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookAllResults'));
$result = $this->callAPISuccess('contact', 'get', array(
'check_permissions' => 1,