Skip to content
Snippets Groups Projects
Commit b8d31927 authored by Elmar Ludwig's avatar Elmar Ludwig Committed by Jan-Hendrik Willms
Browse files

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

Merge request !1366
parent d954d4d1
No related branches found
No related tags found
No related merge requests found
......@@ -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