[BUGFIX] Fix 'Transfer selection to clipboard' button 30/47030/2
authorJan Helke <typo3@helke.de>
Thu, 3 Mar 2016 23:23:11 +0000 (00:23 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 4 Mar 2016 10:29:00 +0000 (11:29 +0100)
This patch reintroduces the onclick event if the function call has no
warning. This fixes the error with the not working 'Transfer selection
to clipboard' button in the list view, if the user enables every clipboard
but the normal.

Resolves: #74122
Releases: master, 7.6
Change-Id: Iaf133951fa6278778bb468eca601185844f19130
Reviewed-on: https://review.typo3.org/47030
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Eugen Lang <eugen.lang@werkraum.net>
Tested-by: Eugen Lang <eugen.lang@werkraum.net>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index 2c94454..0475884 100644 (file)
@@ -1978,7 +1978,10 @@ class DatabaseRecordList extends AbstractDatabaseRecordList
             $attributes['data-severity'] = 'warning';
             $attributes['data-title'] = $title;
             $attributes['data-content'] = $warning;
+        } else {
+            $attributes['onclick'] = htmlspecialchars(($jsCode . 'return false;'));
         }
+
         $attributesString = '';
         foreach ($attributes as $key => $value) {
             $attributesString .= ' ' . $key . '="' . htmlspecialchars($value) . '"';