From: Coleman Watts Date: Thu, 7 Jan 2016 19:23:52 +0000 (-0500) Subject: CRM-17795 - Fix uniqueName handling in api.get X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=984f31ae00da46cedfdbf6ec0845facc7897325f;p=civicrm-core.git CRM-17795 - Fix uniqueName handling in api.get --- 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']])) {