From 70a68c0d12a9960ff266626ade90c9f5897ef0af Mon Sep 17 00:00:00 2001
From: Nestor <npegane@hotmail.com>
Date: Fri, 6 Apr 2018 10:49:07 +0200
Subject: [PATCH] FEAT #7413 fix withFile parameter + query on res_letterbox

---
 src/app/resource/controllers/ResController.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/app/resource/controllers/ResController.php b/src/app/resource/controllers/ResController.php
index bf53e15503d..aab6d3506c2 100755
--- a/src/app/resource/controllers/ResController.php
+++ b/src/app/resource/controllers/ResController.php
@@ -261,7 +261,7 @@ class ResController
         $check = Validator::stringType()->notEmpty()->validate($data['clause']);
         $check = $check && Validator::stringType()->notEmpty()->validate($data['select']);
         if(!empty($data['withFile'])){
-            $check = $check && Validator::boolType()->validate($withFile);
+            $check = $check && Validator::boolType()->validate($data['withFile']);
         }
 
         if(!empty($data['orderBy'])){
@@ -297,9 +297,9 @@ class ResController
         }
 
         $resources = ResModel::getOnView(['select' => $select, 'where' => $where, 'orderBy' => $orderBy, 'limit' => $limit]);
-        if($withFile === true){
+        if($data['withFile'] === true){
             foreach($resources as &$res){
-                $path = ResDocserverModel::getSourceResourcePath(['resId' => $res['res_id'], 'resTable' => 'res_view_letterbox', 'adrTable' => 'null']);
+                $path = ResDocserverModel::getSourceResourcePath(['resId' => $res['res_id'], 'resTable' => 'res_letterbox', 'adrTable' => 'null']);
                 $file = file_get_contents($path);
                 $base64Content = base64_encode($file);
                 $res['fileBase64Content'] = $base64Content;
-- 
GitLab