Skip to content

Commit

Permalink
Allowing string relations (directus#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesasol authored and Lapsus committed May 8, 2019
1 parent f2adc6e commit 1a04fe1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,8 @@ public function loadManyToOneRelationships($entries, $columns, array $params = [
foreach ($entries as &$parentRow) {
if (array_key_exists($relationalColumnName, $parentRow)) {
// @NOTE: Not always will be a integer
$foreign_id = (int)$parentRow[$relationalColumnName];
// @NOTE: But what about UUIDS and slugs?
$foreign_id = (string)$parentRow[$relationalColumnName];
$parentRow[$relationalColumnName] = null;
// "Did we retrieve the foreign row with this foreign ID in our recent query of the foreign table"?
if (array_key_exists($foreign_id, $relatedEntries)) {
Expand Down

0 comments on commit 1a04fe1

Please sign in to comment.