Browse code

Fix truncate sql error by changing sec_dl_access flag

Benjamin Roth authored on11/09/2023 10:38:46
Showing4 changed files
... ...
@@ -25,10 +25,12 @@ PaletteManipulator::create()
25 25
  */
26 26
 $GLOBALS['TL_DCA']['tl_user']['fields']['sec_dl_access'] = array
27 27
 (
28
-    'label'                 => &$GLOBALS['TL_LANG']['tl_user']['sec_dl_access'],
28
+    'label'                 => &$GLOBALS['TL_LANG']['tl_user_group']['sec_dl_access'],
29 29
     'exclude'               => true,
30 30
     'filter'                => true,
31
+    'options'               => array('edit'),
32
+    'reference'             => &$GLOBALS['TL_LANG']['MSC'],
31 33
     'inputType'             => 'checkbox',
32
-    'sql'                   => "char(1) NOT NULL default ''"
34
+    'sql'                   => "blob NULL"
33 35
 
34 36
 );
... ...
@@ -26,7 +26,9 @@ $GLOBALS['TL_DCA']['tl_user_group']['fields']['sec_dl_access'] = array
26 26
     'label'                 => &$GLOBALS['TL_LANG']['tl_user_group']['sec_dl_access'],
27 27
     'exclude'               => true,
28 28
     'filter'                => true,
29
+    'options'               => array('edit'),
30
+    'reference'             => &$GLOBALS['TL_LANG']['MSC'],
29 31
     'inputType'             => 'checkbox',
30
-    'sql'                   => "char(1) NOT NULL default ''"
32
+    'sql'                   => "blob NULL"
31 33
 
32 34
 );
... ...
@@ -42,7 +42,7 @@ class MemberListener {
42 42
      */
43 43
     public function onListSecureDownloadsOperationCallback(array $row, ?string $href, string $label, string $title, ?string $icon, string $attributes, string $table, array $rootRecordIds, ?array $childRecordIds, bool $circularReference, ?string $previous, ?string $next, DataContainer $dc)
44 44
     {
45
-        if (!$this->User->isAdmin && !$this->User->hasAccess(1,'sec_dl_access'))
45
+        if (!$this->User->isAdmin && !$this->User->hasAccess('edit','sec_dl_access'))
46 46
         {
47 47
             return '';
48 48
         }
... ...
@@ -53,7 +53,7 @@ class MemberSecureDownloadsListener {
53 53
      */
54 54
     public function onListEditOperationCallback(array $row, ?string $href, string $label, string $title, ?string $icon, string $attributes, string $table, array $rootRecordIds, ?array $childRecordIds, bool $circularReference, ?string $previous, ?string $next, DataContainer $dc)
55 55
     {
56
-        if (!$this->User->isAdmin && !$this->User->hasAccess(1,'sec_dl_access'))
56
+        if (!$this->User->isAdmin && !$this->User->hasAccess('edit','sec_dl_access'))
57 57
         {
58 58
             return '';
59 59
         }
... ...
@@ -72,7 +72,7 @@ class MemberSecureDownloadsListener {
72 72
      */
73 73
     public function onListDeleteOperationCallback(array $row, ?string $href, string $label, string $title, ?string $icon, string $attributes, string $table, array $rootRecordIds, ?array $childRecordIds, bool $circularReference, ?string $previous, ?string $next, DataContainer $dc)
74 74
     {
75
-        if (!$this->User->isAdmin && !$this->User->hasAccess(1,'sec_dl_access'))
75
+        if (!$this->User->isAdmin && !$this->User->hasAccess('edit','sec_dl_access'))
76 76
         {
77 77
             return '';
78 78
         }