Jake Vanderwerf
2026-01-05 9f86429a1252b45c95b7c62fbaa1b82de3723997
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');