Skip to content
Snippets Groups Projects
Commit 48625bd1 authored by André Noack's avatar André Noack Committed by Jan-Hendrik Willms
Browse files

Resolve #1588 "datafields collection an SORM Objekte ist immer leer"

Closes #1588

Merge request studip/studip!1017
parent 560536b3
No related branches found
No related tags found
No related merge requests found
...@@ -2142,7 +2142,7 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate ...@@ -2142,7 +2142,7 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate
if ($options['type'] === 'has_many') { if ($options['type'] === 'has_many') {
$records = function($record) use ($to_call, $params, $options) { $records = function($record) use ($to_call, $params, $options) {
$p = (array)$params($record); $p = (array)$params($record);
return call_user_func_array($to_call, array_merge(count($p) ? $p : [null], [$options['order_by'] ?? ''])); return call_user_func_array($to_call, array_merge(count($p) ? $p : [null], [$options['order_by'] ?? null]));
}; };
$this->relations[$relation] = new SimpleORMapCollection($records, $options, $this); $this->relations[$relation] = new SimpleORMapCollection($records, $options, $this);
} elseif ($options['type'] === 'has_and_belongs_to_many') { } elseif ($options['type'] === 'has_and_belongs_to_many') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment