From 7e98a8d43ae8dbc508bc61a6bab9311e3ff7a9c1 Mon Sep 17 00:00:00 2001
From: David Siegfried <david.siegfried@uni-vechta.de>
Date: Thu, 2 Mar 2023 10:06:37 +0000
Subject: [PATCH] prevent php-warnings, closes #2237

Closes #2237

Merge request studip/studip!1470
---
 app/views/files/_fileref_tr.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/views/files/_fileref_tr.php b/app/views/files/_fileref_tr.php
index 2b1a6b6b56e..ea831589799 100644
--- a/app/views/files/_fileref_tr.php
+++ b/app/views/files/_fileref_tr.php
@@ -8,7 +8,7 @@ if ($file->isDownloadable($GLOBALS['user']->id)) {
 }
 ?>
 <tr class="<? if ($file->getLastChangeDate() > $last_visitdate && ($file->getUserId() !== $GLOBALS['user']->id)) echo 'new'; ?>"
-    id="fileref_<?= htmlReady($table_id) ?>_<?= htmlReady($file->getId()) ?>"
+    <?= !empty($table_id) ? 'id="' . htmlReady("fileref_{$table_id}_{$file->getId()}") . '"' : '' ?>
     role="row"
     data-permissions="<?= implode($permissions) ?>">
     <? if ($show_bulk_checkboxes) : ?>
-- 
GitLab