Skip to content
Snippets Groups Projects
Commit 2a8091c0 authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

fix findByModel() for object_type "sem" and "inst", re #2104

Merge request studip/studip!1366
parent 3e9cceed
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
......@@ -130,7 +130,16 @@ class DatafieldEntryModel extends SimpleORMap implements PrivacyObject
$params[':one_datafield_id'] = $datafield_id;
}
if ($object_type === 'studycourse') {
if ($object_type === 'sem' || $object_type === 'inst') {
// find datafields by status (int)
$query .= " AND (object_class = :object_class OR object_class IS NULL) ORDER BY priority";
$params = array_merge($params, [
':range_id' => (string) $range_id,
':sec_range_id' => (string) $sec_range_id,
':object_type' => $object_type,
':object_class' => (int) $object_class
]);
} else if ($object_type === 'studycourse') {
$query .= " AND (LOCATE(:object_class, object_class) OR LOCATE('all', object_class)) ORDER BY priority";
$params = array_merge($params,[
':range_id' => (string) $range_id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment