Partial contacts now load associated real contacts when searching (#1307)

This commit is contained in:
Danny
2018-05-13 21:06:04 -04:00
committed by Régis Freyd
parent 5438307fc3
commit 401582b1b6
3 changed files with 11 additions and 1 deletions
+3
View File
@@ -1,5 +1,8 @@
UNRELEASED CHANGES:
* Remove automatic birthday reminder creation when editing a contact
* Use external list of countries, with translations and reliability
* Fixes Contact search dropdown shows non-contacts that link to nowhere
* Add ability to sort contact list by untagged contacts
* Allow multiple imported fields and replace existing contacts
+1
View File
@@ -56,6 +56,7 @@ class Contact extends Model
'account_id',
'created_at',
'updated_at',
'is_partial',
];
/**
+7 -1
View File
@@ -458,7 +458,13 @@ class ContactsController extends Controller
if (count($results) !== 0) {
foreach ($results as $key => $result) {
$results[$key]->hash = $result->hashID();
if ($result->is_partial) {
$real = $result->getRelatedRealContact();
$results[$key]->hash = $real->hashID();
} else {
$results[$key]->hash = $result->hashID();
}
}
return $results;