From b1e8ded7a8cec12196489194bd212a86974770a0 Mon Sep 17 00:00:00 2001 From: Fabian Helfer Date: Mon, 2 Feb 2026 12:47:03 +0100 Subject: [PATCH 1/2] [Fix] 0047061: Audio/Video elements must not have empty id attribute --- .../Implementation/Component/Player/Renderer.php | 13 +++++++++---- .../ILIAS/UI/tests/Component/Item/ItemTest.php | 2 +- .../UI/tests/Component/Player/PlayerAudioTest.php | 2 +- .../UI/tests/Component/Player/PlayerVideoTest.php | 10 +++++----- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/components/ILIAS/UI/src/Implementation/Component/Player/Renderer.php b/components/ILIAS/UI/src/Implementation/Component/Player/Renderer.php index 9489d4788a3e..7b80de25069b 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Player/Renderer.php +++ b/components/ILIAS/UI/src/Implementation/Component/Player/Renderer.php @@ -45,7 +45,9 @@ public function renderAudio(Component\Component $component, RendererInterface $d { $tpl = $this->getTemplate("tpl.audio.html", true, true); - $id = $this->bindJavaScript($component); + // Always provide a non-empty id attribute. If there is no JS binding, + // fall back to a plain, unique id. + $id = $this->bindJavaScript($component) ?? $this->createId(); if ($component->getTranscription() != "") { $factory = $this->getUIFactory(); @@ -96,7 +98,8 @@ public function renderVimeo( $tpl = $this->getTemplate("tpl.video_vimeo.html", true, true); - $id = $this->bindJavaScript($component); + // Ensure the iframe always has a valid, non-empty id attribute. + $id = $this->bindJavaScript($component) ?? $this->createId(); $tpl->setVariable("ID", $id); $tpl->setVariable("SOURCE", $component->getSource()); @@ -111,7 +114,8 @@ public function renderYoutube( $tpl = $this->getTemplate("tpl.video_youtube.html", true, true); - $id = $this->bindJavaScript($component); + // Ensure the iframe always has a valid, non-empty id attribute. + $id = $this->bindJavaScript($component) ?? $this->createId(); $tpl->setVariable("ID", $id); $tpl->setVariable("SOURCE", $component->getSource()); @@ -126,7 +130,8 @@ public function renderNative( $tpl = $this->getTemplate("tpl.video.html", true, true); - $id = $this->bindJavaScript($component); + // Ensure the