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

fix some warnings, fixes #1675

Closes #1675

Merge request studip/studip!1079
parent 4b0c621c
No related branches found
No related tags found
No related merge requests found
...@@ -118,7 +118,9 @@ class Avatar { ...@@ -118,7 +118,9 @@ class Avatar {
public function getCustomAvatarUrl($size, $ext = 'png') public function getCustomAvatarUrl($size, $ext = 'png')
{ {
$retina = $GLOBALS['auth']->auth['devicePixelRatio'] > 1.2; $retina = isset($GLOBALS['auth']->auth['devicePixelRatio'])
? $GLOBALS['auth']->auth['devicePixelRatio'] > 1.2
: false;
$size = $retina && file_exists($this->getCustomAvatarPath($size, 'png', true)) $size = $retina && file_exists($this->getCustomAvatarPath($size, 'png', true))
? $size."@2x" ? $size."@2x"
: $size; : $size;
......
...@@ -308,8 +308,8 @@ class MyRealmModel ...@@ -308,8 +308,8 @@ class MyRealmModel
foreach ($courses as $index => $course) { foreach ($courses as $index => $course) {
// export object to array for simple handling // export object to array for simple handling
$_course = $course->toArray($param_array); $_course = $course->toArray($param_array);
$_course['start_semester'] = $course->start_semester->name; $_course['start_semester'] = $course->start_semester ? $course->start_semester->name : null;
$_course['end_semester'] = $course->end_semester->name; $_course['end_semester'] = $course->end_semester ? $course->end_semester->name : null;
$_course['sem_class'] = $course->getSemClass(); $_course['sem_class'] = $course->getSemClass();
$_course['obj_type'] = 'sem'; $_course['obj_type'] = 'sem';
......
...@@ -514,8 +514,11 @@ class Navigation implements IteratorAggregate ...@@ -514,8 +514,11 @@ class Navigation implements IteratorAggregate
*/ */
public function insertSubNavigation($name, Navigation $navigation, $where) public function insertSubNavigation($name, Navigation $navigation, $where)
{ {
$subnav = [];
$done = false;
foreach ($this->getSubNavigation() as $key => $nav) { foreach ($this->getSubNavigation() as $key => $nav) {
if ($key == $where) { if ($key === $where) {
$subnav[$name] = $navigation; $subnav[$name] = $navigation;
$done = true; $done = true;
} }
......
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