From 30f62c2ff8fb770d4010c1c7906dfaf05f5d5b9b Mon Sep 17 00:00:00 2001 From: Matthew Barbour Date: Tue, 16 Jun 2020 18:17:48 -0500 Subject: [PATCH] Fixed transaction issue between cron uploader and bulk import --- ext/cron_uploader/main.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/cron_uploader/main.php b/ext/cron_uploader/main.php index 5e6a1f7e..fc94ab78 100644 --- a/ext/cron_uploader/main.php +++ b/ext/cron_uploader/main.php @@ -354,7 +354,9 @@ class CronUploader extends Extension $database->begin_transaction(); $this->log_message(SCORE_LOG_INFO, "Adding file: {$img[0]} - tags: {$img[2]}"); $result = $this->add_image($img[0], $img[1], $img[2]); - $database->commit(); + if ($database->is_transaction_open()) { + $database->commit(); + } $this->move_uploaded($img[0], $img[1], $output_subdir, false); if ($result->merged) { $merged++;