From ce855c181fd6cf7f44c5a9b3ba55ffcda4b47110 Mon Sep 17 00:00:00 2001
From: David Siegfried <david.siegfried@uni-vechta.de>
Date: Fri, 3 Mar 2023 08:50:26 +0000
Subject: [PATCH] prevent php-warnings, closes #2248

Closes #2248

Merge request studip/studip!1481
---
 app/views/course/details/index.php        | 2 +-
 app/views/study_area/tree.php             | 1 +
 templates/dates/seminar_html_location.php | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/views/course/details/index.php b/app/views/course/details/index.php
index d5081810cd8..3b9d86ccd25 100644
--- a/app/views/course/details/index.php
+++ b/app/views/course/details/index.php
@@ -363,7 +363,7 @@
     </article>
 <? endif ?>
 
-<? if ($study_areas && count($study_areas) > 0) : ?>
+<? if (!empty($study_areas)) : ?>
     <article class="studip">
         <header>
             <h1><?= _('Studienbereiche') ?></h1>
diff --git a/app/views/study_area/tree.php b/app/views/study_area/tree.php
index 79778bbea40..d3ec538c750 100644
--- a/app/views/study_area/tree.php
+++ b/app/views/study_area/tree.php
@@ -6,6 +6,7 @@
  * @var array $dont_open
  * @var string $compulsory
  */
+$layer = 0;
 ?>
 <li>
 <? if ($node->id !== 'root' && $node->required_children): ?>
diff --git a/templates/dates/seminar_html_location.php b/templates/dates/seminar_html_location.php
index 1c744441e89..faf208a13cb 100644
--- a/templates/dates/seminar_html_location.php
+++ b/templates/dates/seminar_html_location.php
@@ -11,7 +11,7 @@ if (is_array($dates['regular']['turnus_data'])) foreach ($dates['regular']['turn
     if ($cycle['desc'])
         $cycle_output .= ', <i>' . htmlReady($cycle['desc']) . '</i>';
 
-    if ($show_room) :
+    if (!empty($show_room)) :
         $cycle_output .= $this->render_partial('dates/_seminar_rooms', ['assigned' => $cycle['assigned_rooms'],
                                                                         'freetext' => $cycle['freetext_rooms'],
                                                                         'link'     => $link
-- 
GitLab