Skip to content

Commit

Permalink
Fix relatedInUse()
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark authored Jun 27, 2024
1 parent 53aa027 commit a917b0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Model/Table/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function getRelatedInUse($tableName, $groupField = null, $type = 'all', a
}
$tableClass = $this->$tableName->getClassName();
$table = TableRegistry::getTableLocator()->get($tableClass);
$order = $table->order ?? [$tableName . '.' . $this->$tableName->getDisplayField() => 'ASC'];
$order = property_exists($table, 'order') ? $table->order : [$tableName . '.' . $table->getDisplayField() => 'ASC'];

$defaults = [
'contain' => [$tableName],
Expand Down

0 comments on commit a917b0d

Please sign in to comment.