From bad59c66549eb601fed963ed013f9b79305ca003 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Wed, 07 Jan 2026 20:09:14 +0000
Subject: [PATCH] =Feedblock integrated with refactored taxonomy selector

---
 inc/rest/routes/ContentRoutes.php |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/inc/rest/routes/ContentRoutes.php b/inc/rest/routes/ContentRoutes.php
index 468a1a7..3d455d5 100644
--- a/inc/rest/routes/ContentRoutes.php
+++ b/inc/rest/routes/ContentRoutes.php
@@ -369,7 +369,20 @@
 
         foreach ($posts as $ID => $post_data) {
 			if (Features::forContent($post_data['content'])->has('is_timeline') && array_key_exists('timeline', $post_data)) {
-				$results[$ID] =$this->processTimelinePost($ID, $post_data);
+				// Handle timeline posts - ensure we have a valid integer ID
+				$parent_id = (int)$ID;
+
+				// Skip if ID is invalid (0, 'null', etc would become 0)
+				if ($parent_id === 0) {
+					error_log('Invalid timeline parent ID: ' . $ID);
+					$results[$ID] = [
+						'success' => false,
+						'message' => 'Invalid parent post ID for timeline'
+					];
+					continue;
+				}
+
+				$results[$ID] = $this->processTimelinePost($parent_id, $post_data);
 				continue;
 			}
 			if (str_starts_with($ID, 'new')) {
@@ -844,7 +857,6 @@
             $data['images'] = $images;
         }
 
-		error_log('Got Data for post: '.print_r($data, true));
         return $data;
     }
 	protected function extractImages(array $fields = []):array

--
Gitblit v1.10.0