mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Fix for contact sorting when saving
This commit is contained in:
parent
50c63329f2
commit
5c9b435b97
@ -111,7 +111,11 @@ class ClientRepository extends BaseRepository
|
|||||||
|
|
||||||
// If the primary is set ensure it's listed first
|
// If the primary is set ensure it's listed first
|
||||||
usort($contacts, function ($left, $right) {
|
usort($contacts, function ($left, $right) {
|
||||||
return (isset($right['is_primary']) ? $right['is_primary'] : 1) - (isset($left['is_primary']) ? $left['is_primary'] : 0);
|
if (isset($right['is_primary']) && isset($left['is_primary'])) {
|
||||||
|
return $right['is_primary'] - $left['is_primary'];
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach ($contacts as $contact) {
|
foreach ($contacts as $contact) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user