Skip to content
Snippets Groups Projects
Commit dfaffc5c authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fixes #3739

Closes #3739

Merge request studip/studip!2597
parent 1de17074
No related branches found
No related tags found
No related merge requests found
......@@ -677,7 +677,7 @@ class MyRealmModel
// Now sort courses by sem_tree entry order.
uksort($_tmp_courses[$sem_key], function ($a, $b) use ($order, $max) {
return (str_pad($order[$a], $max, '0') - str_pad($order[$b], $max, '0'));
return str_pad($order[$a] ?? '', $max, '0') - str_pad($order[$b] ?? '', $max, '0');
});
//At this point the $_tmp_courses array is sorted by the ordering
......
......@@ -81,9 +81,9 @@ class OERHostOERSI extends OERHost
if (!$material['category']) {
$material['category'] = $material->autoDetectCategory();
}
$material['front_image_content_type'] = $material_data['_source']['image'] ? 'image/jpg' : null;
$material['front_image_content_type'] = !empty($material_data['_source']['image']) ? 'image/jpg' : null;
$material['data'] = [
'front_image_url' => $material_data['_source']['image'],
'front_image_url' => $material_data['_source']['image'] ?? null,
'download' => $material_data['_source']['encoding'][0]['contentUrl'] ?: '',
'id' => $material_data['_id'],
'organization' => $material_data['_source']['sourceOrganization'][0]['name'] ?: $material_data['_source']['publisher'][0]['name']
......@@ -102,7 +102,9 @@ class OERHostOERSI extends OERHost
$material->setUsers($userdata);
//set topics:
$material->setTopics($material_data['_source']['keywords']);
if (isset($material_data['_source']['keywords'])) {
$material->setTopics($material_data['_source']['keywords']);
}
}
} else {
......
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