From 7ae6beeff40b256829a72166943cc823a8e03421 Mon Sep 17 00:00:00 2001
From: Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de>
Date: Wed, 22 Jun 2022 16:24:37 +0000
Subject: [PATCH] fix fallout from ClipboardWidget cleanup, fixes #1133

Closes #1133

Merge request studip/studip!717
---
 lib/classes/sidebar/ClipboardWidget.class.php | 2 +-
 templates/sidebar/room-clipboard-widget.php   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/classes/sidebar/ClipboardWidget.class.php b/lib/classes/sidebar/ClipboardWidget.class.php
index f09615e33c6..376e47e37c4 100644
--- a/lib/classes/sidebar/ClipboardWidget.class.php
+++ b/lib/classes/sidebar/ClipboardWidget.class.php
@@ -80,7 +80,7 @@ class ClipboardWidget extends SidebarWidget
         }
 
         $this->setId("ClipboardWidget_{$this->clipboard_widget_id}");
-        $this->setAdditionalAttribute('data-widget_id', $this->getId());
+        $this->setAdditionalAttribute('data-widget_id', $this->clipboard_widget_id);
         $this->addLayoutCSSClass('clipboard-widget');
     }
 
diff --git a/templates/sidebar/room-clipboard-widget.php b/templates/sidebar/room-clipboard-widget.php
index dfd2a015712..ca584436ca1 100644
--- a/templates/sidebar/room-clipboard-widget.php
+++ b/templates/sidebar/room-clipboard-widget.php
@@ -12,7 +12,6 @@
         ]
         ); ?>
 
-<? if (!$readonly): ?>
     <ul class="widget-list widget-links invisible">
     <? foreach ($elements as $index => $element): ?>
         <li id="<?= htmlReady('link-' . md5($element->url)) ?>" <?= $element->icon ? 'style="' . $element->icon->asCSS() .'"' : '' ?>>
@@ -23,6 +22,8 @@
         </li>
     <? endforeach; ?>
     </ul>
+</div>
+<? if (!$readonly): ?>
     <form class="default new-clipboard-form"
           action="<?= URLHelper::getLink(
                   'dispatch.php/clipboard/add'
@@ -49,4 +50,3 @@
 
     </form>
 <? endif ?>
-</div>
-- 
GitLab