Skip to content

Commit

Permalink
fix old many to many infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
wellingguzman committed Nov 28, 2016
1 parent 7452570 commit 6680188
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/core/Directus/Db/TableGateway/RelationalTableGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,11 @@ public function loadManyToOneRelationships($schemaArray, $table_entries, $parent
return $table_entries;
}

$this->addToManyCallStack($level, is_null($parentField) ? $foreign_id_column : $parentField, $foreign_table_name);
if (is_null($parentField)) {
$parentField = $foreign_id_column;
}

$this->addToManyCallStack($level, $parentField, $foreign_table_name);

// Aggregate all foreign keys for this relationship (for each row, yield the specified foreign id)
$yield = function ($row) use ($foreign_id_column, $table_entries) {
Expand Down

0 comments on commit 6680188

Please sign in to comment.