From 9f86429a1252b45c95b7c62fbaa1b82de3723997 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 05 Jan 2026 18:16:07 +0000
Subject: [PATCH] =Complete TaxonomySelector.js and TaxonomyCreator.js refactor

---
 inc/rest/routes/UploadRoutes.php |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/inc/rest/routes/UploadRoutes.php b/inc/rest/routes/UploadRoutes.php
index 56daf36..6052ab5 100644
--- a/inc/rest/routes/UploadRoutes.php
+++ b/inc/rest/routes/UploadRoutes.php
@@ -1092,10 +1092,9 @@
 			$args = $this->buildUploadArgs($request);
 			$data = $request->get_params();
 
-
-			error_log('[UploadRoutes]:handleGroupingRequest: data'.print_r($data, true));
-			error_log('[UploadRoutes]:handleGroupingRequest: args'.print_r($args, true));
-
+			error_log('get_file_params: '.print_r($files, true));
+			global $_FILES;
+			error_log('Global Files: '.print_r($_FILES, true));
 
 			if (!$args['content'] || !$args['user'] || !$args['posts']) {
 
@@ -1118,7 +1117,7 @@
 			}
 
 			// Queue file upload operation
-			$operation_type = $this->determineOperationType($secured_data['files'][0] ?? []);
+			$operation_type = $this->determineOperationType($secured_files['files'][0] ?? []);
 			$chunkSize = 5;
 			if ($operation_type === 'video') {
 				$chunkSize = 1;
@@ -1227,11 +1226,12 @@
 			$created_posts = [];
 			$used_upload_ids = [];
 
+			error_log('Processing Group Data: '.print_r($data, true));
 			// Create posts from groups
 			foreach ($data['posts'] as $index => $post) {
 				$post_title = !empty($post['fields']['post_title'])
 					? sanitize_text_field($post['fields']['post_title'])
-					: 'New ' . JVB_CONTENT[$content]['singular'] . ' ' . ($index + 1);
+					: 'New ' . JVB_CONTENT[$data['content']]['singular'] . ' ' . ($index + 1);
 
 				$post_excerpt = !empty($post['fields']['post_excerpt'])
 					? sanitize_textarea_field($post['fields']['post_excerpt'])
@@ -1279,7 +1279,7 @@
 						set_post_thumbnail($new_post_id, (int)$gallery_attachment_ids[0]);
 						array_shift($gallery_attachment_ids);
 					}
-
+					error_log('Remaining Gallery images: '.print_r($gallery_attachment_ids, true));
 					// Set gallery images
 					if (!empty($gallery_attachment_ids)) {
 						$meta = new MetaManager($new_post_id, 'post');
@@ -1330,7 +1330,9 @@
 			$used_upload_ids = [];
 
 			$content = jvbCheckBase($data['content']);
+			error_log('[processTimelineUploads]Got content: '.print_r($content, true));
 			$config = Features::getConfig($content);
+			error_log('[processTimelineUploads]Got config: '.print_r($config, true));
 			$defaultTitle = 'New '.$config['singular']. ' ';
 			foreach ($data['posts'] as $index=> $post) {
 				$title = !empty($post['fields']['post_title'])

--
Gitblit v1.10.0