Skip to content

Commit 95b1c72

Browse files
committed
fix: workaround to send the fileId ahead
Signed-off-by: Vitor Mattos <[email protected]>
1 parent 3d9b0b6 commit 95b1c72

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/Db/SignRequestMapper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ private function getFilesAssociatedFilesWithMeStmt(
645645

646646
private function formatListRow(array $row): array {
647647
$internalId = (int)$row['id'];
648+
$row['fileId'] = $internalId;
648649
$row['id'] = (int)$row['node_id'];
649650
$row['status'] = (int)$row['status'];
650651
$row['statusText'] = $this->fileMapper->getTextOfStatus($row['status']);

lib/Service/FileService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ public function listAssociatedFilesOfSignFlow(
833833
$sort,
834834
);
835835

836-
$signers = $this->signRequestMapper->getByMultipleFileId(array_column($return['data'], 'id'));
836+
$signers = $this->signRequestMapper->getByMultipleFileId(array_column($return['data'], 'fileId'));
837837
$identifyMethods = $this->signRequestMapper->getIdentifyMethodsFromSigners($signers);
838838
$visibleElements = $this->signRequestMapper->getVisibleElementsFromSigners($signers);
839839
$return['data'] = $this->associateAllAndFormat($this->me, $return['data'], $signers, $identifyMethods, $visibleElements);
@@ -849,7 +849,7 @@ private function associateAllAndFormat(IUser $user, array $files, array $signers
849849
foreach ($files as $key => $file) {
850850
$totalSigned = 0;
851851
foreach ($signers as $signerKey => $signer) {
852-
if ($signer->getFileId() === $file['id']) {
852+
if ($signer->getFileId() === $file['fileId']) {
853853
/** @var array<IdentifyMethod> */
854854
$identifyMethodsOfSigner = $identifyMethods[$signer->getId()] ?? [];
855855
$data = [
@@ -956,7 +956,7 @@ private function associateAllAndFormat(IUser $user, array $files, array $signers
956956

957957
$files[$key]['statusText'] = $this->fileMapper->getTextOfStatus((int)$files[$key]['status']);
958958
}
959-
unset($files[$key]['id']);
959+
unset($files[$key]['id'], $files[$key]['fileId']);
960960
ksort($files[$key]);
961961
}
962962
return $files;

0 commit comments

Comments
 (0)