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:
stages:
- test
- deploy
before_script:
- apt-get update -yqq > /dev/null
......@@ -107,3 +108,16 @@ job_php-7.2:
- develop
except:
- 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
} else {
$oLinkedResources = ResModel::getById(['resId' => $resource['resId'], 'select' => ['linked_resources']]);
$linkedResources = json_decode($oLinkedResources['linked_resources'], true);
$attachments = AttachmentModel::get([
'select' => ['res_id', 'res_id_master', 'recipient_type', 'recipient_id', 'typist', 'status', 'attachment_type',
'creation_date', 'identifier', 'title', 'format', 'docserver_id', 'origin'],
'where' => ['res_id_master in (?)', 'status not in (?)'],
'data' => [$linkedResources, ['DEL', 'OBS']],
'orderBy' => ['creation_date desc']
]);
$attachments = [];
if (!empty($linkedResources)) {
$attachments = AttachmentModel::get([
'select' => ['res_id', 'res_id_master', 'recipient_type', 'recipient_id', 'typist', 'status', 'attachment_type',
'creation_date', 'identifier', 'title', 'format', 'docserver_id', 'origin'],
'where' => ['res_id_master in (?)', 'status not in (?)'],
'data' => [$linkedResources, ['DEL', 'OBS']],
'orderBy' => ['creation_date desc']
]);
}
}
$attachmentsIds = array_column($attachments, 'res_id');
......@@ -447,7 +450,7 @@ class FolderPrintController
if (!is_array($resource['linkedResources'])) {
$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']);
}
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