Browse code

Update

Benjamin Roth authored on01/08/2023 10:07:08
Showing1 changed files
... ...
@@ -74,7 +74,7 @@ class SecureDownloadsController extends AbstractContentElementController
74 74
         }
75 75
 
76 76
         // Get member files for authenticated user
77
-        $objPage = $this->getPageModel();
77
+        $strLocale = $request->getLocale();
78 78
         $allowedDownload = StringUtil::trimsplit(',', strtolower(\Config::get('allowedDownload')));
79 79
         $UserFiles = $this->db->executeQuery("SELECT uuid FROM tl_member_secureDownloads WHERE pid = ?",[$this->User->id]);
80 80
 
... ...
@@ -109,7 +109,7 @@ class SecureDownloadsController extends AbstractContentElementController
109 109
                     continue;
110 110
                 }
111 111
 
112
-                $arrMeta = $objFiles->current()->getMetaData($objPage->language);
112
+                $arrMeta = $objFiles->current()->getMetaData($strLocale);
113 113
 
114 114
                 if (empty($arrMeta))
115 115
                 {
... ...
@@ -117,7 +117,7 @@ class SecureDownloadsController extends AbstractContentElementController
117 117
                     {
118 118
                         continue;
119 119
                     }
120
-                    elseif (($objPage->rootFallbackLanguage !== null && ($arrMeta = $objFiles->current()->getMetaData($objPage->rootFallbackLanguage)) === null) || $arrMeta === null)
120
+                    elseif (($arrMeta = $objFiles->current()->getMetaData('en')) === null || $arrMeta === null)
121 121
                     {
122 122
                         $arrMeta = [];
123 123
                     }
... ...
@@ -186,7 +186,7 @@ class SecureDownloadsController extends AbstractContentElementController
186 186
                         continue;
187 187
                     }
188 188
 
189
-                    $arrMeta = $objSubfiles->current()->getMetaData($objPage->language);
189
+                    $arrMeta = $objSubfiles->current()->getMetaData($strLocale);
190 190
 
191 191
                     if (empty($arrMeta))
192 192
                     {
... ...
@@ -194,7 +194,7 @@ class SecureDownloadsController extends AbstractContentElementController
194 194
                         {
195 195
                             continue;
196 196
                         }
197
-                        elseif (($objPage->rootFallbackLanguage !== null && ($arrMeta = $objSubfiles->current()->getMetaData($objPage->rootFallbackLanguage)) === null) || $arrMeta === null)
197
+                        elseif (($arrMeta = $objSubfiles->current()->getMetaData('en')) === null || $arrMeta === null)
198 198
                         {
199 199
                             $arrMeta = [];
200 200
                         }