From d25fae0c10630ae4c7b8d6a2561a520bb69e8f09 Mon Sep 17 00:00:00 2001 From: Carl Whittick Date: Mon, 22 Apr 2019 20:19:19 +0100 Subject: [PATCH] Fixing custom primary key primary key column name (#881) Swapping this variable seems to resolve the issue. --- .../Directus/Database/TableGateway/RelationalTableGateway.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Directus/Database/TableGateway/RelationalTableGateway.php b/src/core/Directus/Database/TableGateway/RelationalTableGateway.php index f3fd506c6e..51f3b9e7a3 100644 --- a/src/core/Directus/Database/TableGateway/RelationalTableGateway.php +++ b/src/core/Directus/Database/TableGateway/RelationalTableGateway.php @@ -1755,7 +1755,7 @@ public function loadOneToManyRelationships($entries, $columns, array $params = [ // $row->getId(); RowGateway perhaps? $relationalColumnId = $row[$relationalColumnName]; if (is_array($relationalColumnId) && !empty($relationalColumnId)) { - $relationalColumnId = $relationalColumnId[$tableGateway->primaryKeyFieldName]; + $relationalColumnId = $relationalColumnId[$primaryKey]; } if ($filterFields && !in_array('*', $filterFields)) {