diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-21 18:18:34 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-21 18:18:34 +0100 |
| commit | 3f404879e72089414a5ce3282433cf5d1795b591 (patch) | |
| tree | 0c788de1c04c910eb814c9747d513bd49e4f1718 | |
| parent | cf5b197d150638bdfc7238124965c3c9cf94e899 (diff) | |
| download | fisheye-3f404879e72089414a5ce3282433cf5d1795b591.tar.gz fisheye-3f404879e72089414a5ce3282433cf5d1795b591.tar.bz2 fisheye-3f404879e72089414a5ce3282433cf5d1795b591.zip | |
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 <noreply@anthropic.com>
| -rwxr-xr-x | includes/classes/FisheyeBase.php | 7 |
1 files 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; } |
