From 68ce7fac0b1f1ba275783a588f7d95ad5ae6abbc Mon Sep 17 00:00:00 2001
From: Hamza HRAMCHI <hamza.hramchi@xelians.fr>
Date: Mon, 13 Feb 2023 15:52:51 +0100
Subject: [PATCH] Revert "FIX #19031 TIME 0:05 fix History: undefined key"

This reverts commit 4c48f21093473e903eb4bf962dc4ab224e7f99b3.
---
 src/app/history/controllers/HistoryController.php | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/app/history/controllers/HistoryController.php b/src/app/history/controllers/HistoryController.php
index 41a2359600..e329bb75e4 100644
--- a/src/app/history/controllers/HistoryController.php
+++ b/src/app/history/controllers/HistoryController.php
@@ -210,9 +210,7 @@ class HistoryController
                 $objects = array_column($objects, 'title', 'id');
 
                 foreach ($filteredHistoryIds as $key => $objectId) {
-                    if (!empty($key)) {
-                        $history[$key]['label'] = $objects[$objectId];
-                    }
+                    $history[$key]['label'] = $objects[$objectId];
                 }
             }
         }
@@ -435,7 +433,7 @@ class HistoryController
         }
 
         $queryParams = $request->getQueryParams();
-        if (!$queryParams['onlyProof'] || empty($proofDocument)) {
+        if (!empty($queryParams['onlyProof']) && (!$queryParams['onlyProof'] || empty($proofDocument))) {
             $formattedHistory = HistoryController::getFormattedHistory(['id' => $args['id']]);
             $historyXml       = HistoryController::arrayToXml(['data' => $formattedHistory['formattedHistory'], 'xml' => false]);
             $historyXmlPath = $tmpPath . 'maarchProof' . $GLOBALS['id'] . "_" . rand() . '.xml';
@@ -489,8 +487,7 @@ class HistoryController
                 }
             }
         }
-
-        if (!$queryParams['onlyProof']) {
+        if (!empty($queryParams['onlyProof']) && !$queryParams['onlyProof']) {
             if ($workflowCompleted && ($queryParams['eSignDocument'] ?? $hasCertificate)) {
                 $contentType = 'ESIGN';
             }
-- 
GitLab