Skip to content

Commit

Permalink
Merge pull request #16004 from civicrm/5.20
Browse files Browse the repository at this point in the history
5.20
  • Loading branch information
seamuslee001 authored Dec 2, 2019
2 parents 31eb103 + 7b72278 commit 5e128ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -4768,8 +4768,13 @@ public static function isCustomDateField($fieldName) {
if (($customFieldID = CRM_Core_BAO_CustomField::getKeyID($fieldName)) == FALSE) {
return FALSE;
}
if ('Date' == civicrm_api3('CustomField', 'getvalue', ['id' => $customFieldID, 'return' => 'data_type'])) {
return TRUE;
try {
$customFieldDataType = civicrm_api3('CustomField', 'getvalue', ['id' => $customFieldID, 'return' => 'data_type']);
if ('Date' == $customFieldDataType) {
return TRUE;
}
}
catch (CiviCRM_API3_Exception $e) {
}
return FALSE;
}
Expand Down
4 changes: 4 additions & 0 deletions tests/phpunit/CRM/Contact/BAO/SavedSearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public function testDefaultValues() {
$defaults = $sg->setDefaultValues();

$this->checkArrayEquals($defaults, $formValues);
$this->callAPISuccess('CustomField', 'delete', ['id' => $this->ids['CustomField']['int']]);
unset($this->ids['CustomField']['int']);
$defaults = $sg->setDefaultValues();
$this->checkArrayEquals($defaults, $formValues);
}

/**
Expand Down

0 comments on commit 5e128ce

Please sign in to comment.