From 651802059456b3c2d0101bd41fea678ab2e9b8a8 Mon Sep 17 00:00:00 2001 From: Philipp Dieter Date: Fri, 22 Apr 2022 14:02:55 +0200 Subject: [PATCH] [TASK] Add patches for debugging imports --- .../core_fail-fatally-on-failed-inserts.diff | 37 +++++++++++++++++++ ...exp_dont-fail-on-changed-image-hashes.diff | 12 ++++++ 2 files changed, 49 insertions(+) create mode 100644 build/dev/core_fail-fatally-on-failed-inserts.diff create mode 100644 build/dev/impexp_dont-fail-on-changed-image-hashes.diff diff --git a/build/dev/core_fail-fatally-on-failed-inserts.diff b/build/dev/core_fail-fatally-on-failed-inserts.diff new file mode 100644 index 0000000..0010f48 --- /dev/null +++ b/build/dev/core_fail-fatally-on-failed-inserts.diff @@ -0,0 +1,37 @@ +*** webroot/typo3/sysext/core/Classes/DataHandling/DataHandler.php.orig 2022-04-22 13:15:26.314780488 +0200 +--- webroot/typo3/sysext/core/Classes/DataHandling/DataHandler.php 2022-04-22 13:15:39.018129312 +0200 +*************** class DataHandler implements LoggerAware +*** 7431,7446 **** + } + $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($table); + $insertErrorMessage = ''; +! try { + // Execute the INSERT query: + $connection->insert( + $table, + $fieldArray, + $typeArray + ); +! } catch (DBALException $e) { +! $insertErrorMessage = $e->getPrevious()->getMessage(); +! } + // If succees, do...: + if ($insertErrorMessage === '') { + // Set mapping for NEW... -> real uid: +--- 7431,7446 ---- + } + $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($table); + $insertErrorMessage = ''; +! //try { + // Execute the INSERT query: + $connection->insert( + $table, + $fieldArray, + $typeArray + ); +! //} catch (DBALException $e) { +! // $insertErrorMessage = $e->getPrevious()->getMessage(); +! //} + // If succees, do...: + if ($insertErrorMessage === '') { + // Set mapping for NEW... -> real uid: diff --git a/build/dev/impexp_dont-fail-on-changed-image-hashes.diff b/build/dev/impexp_dont-fail-on-changed-image-hashes.diff new file mode 100644 index 0000000..5b572f3 --- /dev/null +++ b/build/dev/impexp_dont-fail-on-changed-image-hashes.diff @@ -0,0 +1,12 @@ +--- webroot/typo3/sysext/impexp/Classes/Import.php 2022-04-22 12:43:09.439221153 +0200 ++++ webroot/typo3/sysext/impexp/Classes/Import.php 2022-04-22 12:43:27.169242298 +0200 +@@ -446,7 +446,8 @@ + } + + if ($newFile->getSha1() !== $fileRecord['sha1']) { +- $this->error('Error: The hash of the written file is not identical to the import data! File could be corrupted! File: "' . $fileRecord['identifier'] . '" with storage uid "' . $fileRecord['storage'] . '"'); ++ print('Error: The hash of the written file is not identical to the import data! File could be corrupted! File: "' . $fileRecord['identifier'] . '" with storage uid "' . $fileRecord['storage'] . '"'); ++ print(PHP_EOL); + } + } +