From a504a49004671287d9e0c78fd107c4abf669cc2a Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 08 Jan 2026 16:52:14 +0000
Subject: [PATCH] Merge branch 'main' of https://github.com/jakevdwerf/jvb
---
inc/rest/routes/UploadRoutes.php | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/inc/rest/routes/UploadRoutes.php b/inc/rest/routes/UploadRoutes.php
index 6052ab5..614e74c 100644
--- a/inc/rest/routes/UploadRoutes.php
+++ b/inc/rest/routes/UploadRoutes.php
@@ -277,7 +277,6 @@
unset($context['upload_ids']);
$config = $this->getFieldConfig($args);
- error_log('secureFiles: '.print_r($files, true));
$file_array = $files['files'] ?? $files;
$tmp_names = isset($file_array['tmp_name'][0]) && is_array($file_array['tmp_name'][0])
? $file_array['tmp_name'][0]
@@ -1092,9 +1091,7 @@
$args = $this->buildUploadArgs($request);
$data = $request->get_params();
- 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']) {
@@ -1226,7 +1223,6 @@
$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'])
@@ -1251,7 +1247,9 @@
$created_posts[] = $new_post_id;
// Get featured image upload_id
- $featured_upload_id = (int)$post['fields']['featured'] ?? null;
+
+
+ $featured_upload_id = array_key_exists('featured', $post['fields']) ? (int)$post['fields']['featured'] : null;
$featured_attachment_id = null;
$gallery_attachment_ids = [];
@@ -1279,7 +1277,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,9 +1328,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