From b38f03c0e7218762d90fa5092696b127f24f36db Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 25 Jan 2026 07:07:26 +0000
Subject: [PATCH] =Some logical flaws in Queue.php, Queue.js, ContentExecutor.php, UploadExecutor.php - particularly with timeline ordering, frontend queue updates, etc

---
 assets/js/concise/FormController.js |   43 +++++++++++++++++++++++++++++--------------
 1 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/assets/js/concise/FormController.js b/assets/js/concise/FormController.js
index 9a3f632..0d7e7ca 100644
--- a/assets/js/concise/FormController.js
+++ b/assets/js/concise/FormController.js
@@ -378,11 +378,14 @@
 		if (this.subscribers.size > 0) {
 			e.preventDefault();
 			console.log('Cancelling scheduled backup and manually backing up');
-			this.cancelBackup();
-			await this.backup();
-			const storedData = await this.store.get(form.id);
+
+
 
 			if (form.options.cache) {
+				this.cancelBackup();
+				await this.backup();
+				const storedData = await this.store.get(form.id);
+
 				this.notify('form-submit', {
 					config: form,
 					data: storedData.changes
@@ -812,7 +815,8 @@
 								let index = config.ui.items?.children?.length??0;
 								el.dataset.index = index;
 								manyRefs.inputs?.forEach(input => {
-									window.prefixInput(input, `${el.dataset.fieldName}:${index}:`)
+									let wrapper = el.closest('[data-field]');
+									window.prefixInput(input, `${el.dataset.fieldName}:${index}:`, wrapper);
 								});
 							}
 						},
@@ -883,7 +887,8 @@
 								let index = config.ui.items?.children?.length??0;
 								el.dataset.index = index;
 								manyRefs.inputs?.forEach(input => {
-									window.prefixInput(input, `${el.dataset.fieldName}:${index}:`)
+									let wrapper = window.closest('.tag-item');
+									window.prefixInput(input, `${el.dataset.fieldName}:${index}:`, wrapper)
 								});
 
 								if (refs.label) {
@@ -1179,19 +1184,29 @@
 	 * @param {HTMLElement} container
 	 */
 	reindexList(container) {
+		const fieldName = container.dataset.field || container.dataset.repeaterId || container.dataset.tagListId;
+
 		Array.from(container.children).forEach((item, index) => {
 			item.dataset.index = `${index}`;
-			Array.from(item.children).forEach(child => {
-				if (child.type === 'hidden') {
-					window.prefixInput(
-						child,
-						`${container.dataset.field}:${index}:${child.dataset.field}`
-					);
-				}
+
+			// Find ALL inputs within this item, not just direct children
+			const inputs = item.querySelectorAll('input, select, textarea');
+
+			inputs.forEach(input => {
+				// Skip inputs that shouldn't be re-indexed (like file inputs)
+				if (input.type === 'file') return;
+
+				// Get the field name from the input's data-field or name
+				const inputField = input.dataset.field || input.name.split(':').pop();
+
+				// Re-prefix with the new index, passing item as wrapper
+				window.prefixInput(
+					input,
+					`${fieldName}:${index}:`,
+					item  // Pass the item as wrapper for label lookup
+				);
 			});
 		});
-
-		//schedule save
 	}
 	/**********************************************************************
 	 VALIDATION

--
Gitblit v1.10.0