Skip to content

Commit

Permalink
Merge pull request #17649 from seamuslee001/fix_array_acess_non_array
Browse files Browse the repository at this point in the history
[REF] Fix PHP7.4 Test fails when we are accessing array keys when the…
  • Loading branch information
eileenmcnaughton authored Jun 18, 2020
2 parents 42e2be5 + 3397409 commit e0c38aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -2049,7 +2049,7 @@ public function whereClause($isForcePrimaryEmailOnly = NULL) {
$this->_params[$id][1]
);
$this->_qill[0][] = ts("%1 %2 %3", [
1 => $field['title'],
1 => $field['title'] ?? '',
2 => $qillop,
3 => $qillVal,
]);
Expand Down
10 changes: 5 additions & 5 deletions tests/phpunit/CRM/Core/BAO/CustomFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ public function testGetDisplayedValuesContactRef() {
];
$createdField = $this->callAPISuccess('customField', 'create', $params);
$contact1 = $this->individualCreate();
$contact2 = $this->individualCreate(['custom_' . $createdField['id'] => $contact1['id']]);

$this->assertEquals($contact1['display_name'], CRM_Core_BAO_CustomField::displayValue($contact2['id'], $createdField['id']));
$contact2 = $this->individualCreate(['custom_' . $createdField['id'] => $contact1]);
$contact1Details = $this->callAPISuccess('Contact', 'getsingle', ['id' => $contact1]);
$this->assertEquals($contact1Details['display_name'], CRM_Core_BAO_CustomField::displayValue($contact2, $createdField['id']));
$this->assertEquals("Bob", CRM_Core_BAO_CustomField::displayValue("Bob", $createdField['id']));

$this->contactDelete($contact2['id']);
$this->contactDelete($contact1['id']);
$this->contactDelete($contact2);
$this->contactDelete($contact1);
$this->customGroupDelete($customGroup['id']);
}

Expand Down

0 comments on commit e0c38aa

Please sign in to comment.