From ee7bc9545bd1965bb95cc89a98d6c336b8a55d06 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Wed, 11 Feb 2026 00:45:25 +0000
Subject: [PATCH] =cleaning up some of the console logs in crud.js
---
inc/managers/queue/executors/UploadExecutor.php | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/inc/managers/queue/executors/UploadExecutor.php b/inc/managers/queue/executors/UploadExecutor.php
index 3cc90a7..0c693d6 100644
--- a/inc/managers/queue/executors/UploadExecutor.php
+++ b/inc/managers/queue/executors/UploadExecutor.php
@@ -636,11 +636,18 @@
return;
}
- $existing = $meta->get($data['field_name']);
- $existingIds = !empty($existing) ? explode(',', $existing) : [];
- $allIds = array_unique(array_merge($existingIds, $attachmentIds));
+ $fieldType = $data['field_type'] ?? 'single';
- $meta->set($data['field_name'], implode(',', $allIds));
+ if ($fieldType === 'single') {
+ // Single field: replace with latest upload
+ $meta->set($data['field_name'], end($attachmentIds));
+ } else {
+ // Multi field: merge with existing
+ $existing = $meta->get($data['field_name']);
+ $existingIds = !empty($existing) ? explode(',', $existing) : [];
+ $allIds = array_unique(array_merge($existingIds, $attachmentIds));
+ $meta->set($data['field_name'], implode(',', $allIds));
+ }
}
private function updateFieldValue(array $data, array $results): void
--
Gitblit v1.10.0