Skip to content
Snippets Groups Projects
Verified Commit 286683b2 authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #13126 TIME 0:10 folder print error without link mail + test publish code coverage

parent 8f4906f4
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ variables: ...@@ -10,6 +10,7 @@ variables:
stages: stages:
- test - test
- deploy
before_script: before_script:
- apt-get update -yqq > /dev/null - apt-get update -yqq > /dev/null
...@@ -107,3 +108,16 @@ job_php-7.2: ...@@ -107,3 +108,16 @@ job_php-7.2:
- develop - develop
except: except:
- schedules - schedules
pages:
stage: deploy
dependencies:
- job_php-7.4
script:
- mv test/unitTests/build/ public/
artifacts:
paths:
- public
expire_in: 1 day
only:
- develop
...@@ -392,13 +392,16 @@ class FolderPrintController ...@@ -392,13 +392,16 @@ class FolderPrintController
} else { } else {
$oLinkedResources = ResModel::getById(['resId' => $resource['resId'], 'select' => ['linked_resources']]); $oLinkedResources = ResModel::getById(['resId' => $resource['resId'], 'select' => ['linked_resources']]);
$linkedResources = json_decode($oLinkedResources['linked_resources'], true); $linkedResources = json_decode($oLinkedResources['linked_resources'], true);
$attachments = AttachmentModel::get([ $attachments = [];
'select' => ['res_id', 'res_id_master', 'recipient_type', 'recipient_id', 'typist', 'status', 'attachment_type', if (!empty($linkedResources)) {
'creation_date', 'identifier', 'title', 'format', 'docserver_id', 'origin'], $attachments = AttachmentModel::get([
'where' => ['res_id_master in (?)', 'status not in (?)'], 'select' => ['res_id', 'res_id_master', 'recipient_type', 'recipient_id', 'typist', 'status', 'attachment_type',
'data' => [$linkedResources, ['DEL', 'OBS']], 'creation_date', 'identifier', 'title', 'format', 'docserver_id', 'origin'],
'orderBy' => ['creation_date desc'] 'where' => ['res_id_master in (?)', 'status not in (?)'],
]); 'data' => [$linkedResources, ['DEL', 'OBS']],
'orderBy' => ['creation_date desc']
]);
}
} }
$attachmentsIds = array_column($attachments, 'res_id'); $attachmentsIds = array_column($attachments, 'res_id');
...@@ -447,7 +450,7 @@ class FolderPrintController ...@@ -447,7 +450,7 @@ class FolderPrintController
if (!is_array($resource['linkedResources'])) { if (!is_array($resource['linkedResources'])) {
$resource['linkedResources'] = $controlResource['linked_resources']; $resource['linkedResources'] = $controlResource['linked_resources'];
} }
if (!ResController::hasRightByResId(['resId' => $resource['linkedResources'], 'userId' => $GLOBALS['id']])) { if (!empty($resource['linkedResources']) && !ResController::hasRightByResId(['resId' => $resource['linkedResources'], 'userId' => $GLOBALS['id']])) {
return $response->withStatus(403)->withJson(['errors' => 'LinkedResources out of perimeter']); return $response->withStatus(403)->withJson(['errors' => 'LinkedResources out of perimeter']);
} }
foreach ($resource['linkedResources'] as $linkedResource) { foreach ($resource['linkedResources'] as $linkedResource) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment