From 6c38619743705e09e36f3a0da74ee54562d55aec Mon Sep 17 00:00:00 2001 From: Charlotte Bataille Date: Thu, 17 Mar 2022 10:13:10 +0100 Subject: [PATCH 1/2] fix/19713 : fix fulltext extraction error --- src/bundle/digitalResource/Controller/digitalResource.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bundle/digitalResource/Controller/digitalResource.php b/src/bundle/digitalResource/Controller/digitalResource.php index d409591cd..9b4463e76 100755 --- a/src/bundle/digitalResource/Controller/digitalResource.php +++ b/src/bundle/digitalResource/Controller/digitalResource.php @@ -882,7 +882,9 @@ class digitalResource file_put_contents($srcfile, $contents); - $fullText .= $fullTextService->getText($srcfile); + try { + $fullText .= $fullTextService->getText($srcfile); + } catch (\Exception $exception) {} } } -- GitLab From a241ca01b97c7df5891f7c343845ff64f40abfcf Mon Sep 17 00:00:00 2001 From: Arnaud PAUGET Date: Fri, 15 Apr 2022 12:28:19 +0200 Subject: [PATCH 2/2] fix(19713) : add try catch test on extractFullText in batch function. --- .../Controller/archiveModificationTrait.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bundle/recordsManagement/Controller/archiveModificationTrait.php b/src/bundle/recordsManagement/Controller/archiveModificationTrait.php index abdcdbd73..ede323569 100755 --- a/src/bundle/recordsManagement/Controller/archiveModificationTrait.php +++ b/src/bundle/recordsManagement/Controller/archiveModificationTrait.php @@ -937,7 +937,10 @@ trait archiveModificationTrait stream_copy_to_stream($handler, $tmpStream); rewind($tmpStream); fclose($tmpStream); - $fullText .= $fulltextService->getText($tmpFile, $options) . " "; + try { + $fullText .= $fulltextService->getText($tmpFile, $options) . " "; + } catch (\Exception $exception) {} + unlink($tmpFile); } $archive = $this->retrieve($archiveId); -- GitLab