diff --git a/migration/19.12/1912.sql b/migration/19.12/1912.sql index c13d80aa6adee4181f1d61a84642699bddcdfa06..14948dc3f3815917df402564df7edbfa30e32cb3 100644 --- a/migration/19.12/1912.sql +++ b/migration/19.12/1912.sql @@ -401,6 +401,7 @@ UPDATE priorities SET delays = 30 WHERE delays IS NULL; ALTER TABLE priorities ALTER COLUMN delays SET NOT NULL; ALTER TABLE res_letterbox ALTER COLUMN status DROP NOT NULL; ALTER TABLE res_letterbox ALTER COLUMN docserver_id DROP NOT NULL; +ALTER TABLE res_letterbox ALTER COLUMN format DROP NOT NULL; /* REFACTORING SUPPRESSION */ diff --git a/src/app/resource/controllers/ResController.php b/src/app/resource/controllers/ResController.php index b79653dfd6c7573c95840c18919fbc83a67502f6..d01b279cc4d78860c7f66441601e18c5b04183d5 100755 --- a/src/app/resource/controllers/ResController.php +++ b/src/app/resource/controllers/ResController.php @@ -699,8 +699,8 @@ class ResController $body = $args['body']; - if (!empty($body['diffusion'])) { - foreach ($body['diffusion'] as $diffusion) { + if (!empty($body['diffusionList'])) { + foreach ($body['diffusionList'] as $diffusion) { if ($diffusion['mode'] == 'dest') { ResModel::update(['set' => ['dest_user' => $diffusion['id']], 'where' => ['res_id = ?'], 'data' => [$args['resId']]]); } @@ -857,12 +857,12 @@ class ResController return ['errors' => 'Body tags : One or more tags do not exist']; } } - if (!empty($body['diffusion'])) { - if (!Validator::arrayType()->notEmpty()->validate($body['diffusion'])) { + if (!empty($body['diffusionList'])) { + if (!Validator::arrayType()->notEmpty()->validate($body['diffusionList'])) { return ['errors' => 'Body diffusion is not an array']; } $destFound = false; - foreach ($body['diffusion'] as $key => $diffusion) { + foreach ($body['diffusionList'] as $key => $diffusion) { if ($diffusion['mode'] == 'dest') { if ($destFound) { return ['errors' => "Body diffusion has multiple dest"];