projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4efe0d5
)
ContactType - Ensure stable order
author
colemanw
<coleman@civicrm.org>
Tue, 12 Dec 2023 16:28:59 +0000
(11:28 -0500)
committer
colemanw
<coleman@civicrm.org>
Tue, 12 Dec 2023 16:28:59 +0000
(11:28 -0500)
MySql *usually* returns records ordered by id, but not always.
This keeps it stable.
CRM/Contact/BAO/ContactType.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Contact/BAO/ContactType.php
b/CRM/Contact/BAO/ContactType.php
index 0059f499e4afed03ff37d62a1666271290dc0342..30c064e88842be7c31a68326c6d9f96bd05086e5 100644
(file)
--- a/
CRM/Contact/BAO/ContactType.php
+++ b/
CRM/Contact/BAO/ContactType.php
@@
-837,6
+837,8
@@
WHERE ($subtypeClause)";
$contactTypes = $cache->get($cacheKey);
if ($contactTypes === NULL) {
$query = CRM_Utils_SQL_Select::from('civicrm_contact_type');
+ // Ensure stable order
+ $query->orderBy('id');
$dao = CRM_Core_DAO::executeQuery($query->toSQL());
$contactTypes = array_column($dao->fetchAll(), NULL, 'name');
$parents = array_column($contactTypes, NULL, 'id');