diff --git a/src/app/document/controllers/DocumentController.php b/src/app/document/controllers/DocumentController.php index fb523bbee90e0a9e4ab0da1f627449736c84ced4..8d9dd43b7986a2e719948526ff59786ac15849a4 100644 --- a/src/app/document/controllers/DocumentController.php +++ b/src/app/document/controllers/DocumentController.php @@ -493,7 +493,7 @@ class DocumentController if ($hasElectronicSignature && $workflow['signatureMode'] == 'stamp' && $workflow['mode'] == 'sign') { return $response->withStatus(400)->withJson(['errors' => "Body workflow[{$key}] signatureMode cannot be stamp after an electronic signature", 'lang' => 'stampInTheMiddleImpossible']); } - if ($workflow['externalInformations']['role'] ?? null == 'otp_sign_yousign' && empty($workflow['signaturePositions'])) { + if (($workflow['externalInformations']['role'] ?? null) == 'otp_sign_yousign' && empty($workflow['signaturePositions'])) { return $response->withStatus(400)->withJson(['errors' => "Body workflow[{$key}] signaturePositions must be set for sign_yousign role"]); } if (!empty($workflow['signaturePositions'])) { @@ -1240,7 +1240,7 @@ class DocumentController return $response->withStatus(400)->withJson(['errors' => 'Docserver does not exist']); } - $pathToThumbnail = $docserver['path'] . $adr[0]['path'] . $adr[0]['filename']; + $pathToThumbnail = $docserver['path'] . $adr[0]['path'] ?? null . $adr[0]['filename'] ?? null; if (!is_file($pathToThumbnail) || !is_readable($pathToThumbnail)) { $configPath = CoreConfigModel::getConfigPath(); exec("php src/app/convert/scripts/ThumbnailScript.php '{$configPath}' {$args['id']} 'document' '{$GLOBALS['id']}' {$args['page']} > /dev/null"); @@ -1588,7 +1588,7 @@ class DocumentController $signHeight = null; } else { $signWidth = ($signature['width'] * $size['width']) / 100; - $signHeight = ($signature['height'] * $size['height']) / 100; + $signHeight = ($signature['height'] ?? null * $size['height'])/ 100; $signPosX = ($signature['positionX'] * $size['width']) / 100; $signPosY = ($signature['positionY'] * $size['height']) / 100; }