diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2022-10-17 14:50:20 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2022-10-17 14:50:20 +0000 |
| commit | 4695506d9ea6d0dce90e16f12ae0bb215ce1a01b (patch) | |
| tree | a5735282a9fa4f1a5f7112608f5b3310584eb16a /lib/functions.php | |
| parent | 169c42d48f6c9a3e9981dea4713ba0b9176dd41e (diff) | |
fix php8 warnings, fixes #1679
Closes #1679
Merge request studip/studip!1084
Diffstat (limited to 'lib/functions.php')
| -rw-r--r-- | lib/functions.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/functions.php b/lib/functions.php index a86a9c4..baa7796 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -88,11 +88,13 @@ function get_object_name($range_id, $object_type) $statement->execute([$range_id]); $row = $statement->fetch(PDO::FETCH_ASSOC); - $type = $INST_TYPE[$row['type']]['name']; - if (!$type) { + if (!$row) { + $name = _('Unbekannt'); $type = _('Einrichtung'); + } else { + $name = $row['Name']; + $type = $INST_TYPE[$row['type']]['name'] ?? _('Einrichtung'); } - $name = $row['Name']; } return compact('name', 'type'); |
