diff --git a/Civi/Api4/Service/Schema/SchemaMapBuilder.php b/Civi/Api4/Service/Schema/SchemaMapBuilder.php index 66efeb3a85e1..74dc0f345369 100644 --- a/Civi/Api4/Service/Schema/SchemaMapBuilder.php +++ b/Civi/Api4/Service/Schema/SchemaMapBuilder.php @@ -70,8 +70,8 @@ private function loadTables(SchemaMap $map) { /** @var \CRM_Core_DAO $daoName */ foreach (AllCoreTables::get() as $daoName => $data) { $table = new Table($data['table']); - foreach ($daoName::fields() as $field => $fieldData) { - $this->addJoins($table, $field, $fieldData); + foreach ($daoName::fields() as $fieldData) { + $this->addJoins($table, $fieldData['name'], $fieldData); } $map->addTable($table); if (in_array($data['name'], $this->apiEntities)) {