From 984f31ae00da46cedfdbf6ec0845facc7897325f Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 7 Jan 2016 14:23:52 -0500 Subject: [PATCH] CRM-17795 - Fix uniqueName handling in api.get --- Civi/API/SelectQuery.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Civi/API/SelectQuery.php b/Civi/API/SelectQuery.php index f9006e97d6..fa5dec4351 100644 --- a/Civi/API/SelectQuery.php +++ b/Civi/API/SelectQuery.php @@ -282,8 +282,8 @@ class SelectQuery { $result_entities[$result_dao->id][$returnName] = $result_dao->$alias; } // Backward compatibility on fields names. - if ($this->isFillUniqueFields && !empty($this->apiFieldSpec[$column]['uniqueName'])) { - $result_entities[$result_dao->id][$this->apiFieldSpec[$column]['uniqueName']] = $result_dao->$alias; + if ($this->isFillUniqueFields && !empty($this->apiFieldSpec[$alias]['uniqueName'])) { + $result_entities[$result_dao->id][$this->apiFieldSpec[$alias]['uniqueName']] = $result_dao->$alias; } foreach ($this->apiFieldSpec as $returnName => $spec) { if (empty($result_entities[$result_dao->id][$returnName]) && !empty($result_entities[$result_dao->id][$spec['name']])) { -- 2.25.1