From 3f404879e72089414a5ce3282433cf5d1795b591 Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Thu, 21 May 2026 18:18:34 +0100 Subject: Fix ancestor walk: use is_numeric key check and direct content_id lookup Replaced isset($galleryData['content_id']) with is_numeric($galleryId) to identify parent gallery entries regardless of column name casing in the getAssoc result. content_id is now fetched via a direct query so the loop reliably advances up the hierarchy to the root. Co-Authored-By: Claude Sonnet 4.6 --- includes/classes/FisheyeBase.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/classes/FisheyeBase.php b/includes/classes/FisheyeBase.php index c73cf3e..f5f4336 100755 --- a/includes/classes/FisheyeBase.php +++ b/includes/classes/FisheyeBase.php @@ -167,10 +167,13 @@ not ready for primetime if( !$parents ) break; $found = false; foreach( $parents as $galleryId => $galleryData ) { - if( is_array( $galleryData ) && isset( $galleryData['content_id'] ) ) { + if( is_numeric( $galleryId ) && is_array( $galleryData ) ) { $ancestors[] = (int)$galleryId; array_unshift( $pathIds, $galleryId ); - $currentContentId = $galleryData['content_id']; + $currentContentId = $this->mDb->getOne( + "SELECT fg.`content_id` FROM `".BIT_DB_PREFIX."fisheye_gallery` fg WHERE fg.`gallery_id`=?", + [(int)$galleryId] + ); $found = true; break; } -- cgit v1.3