summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-21 18:08:42 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-21 18:08:42 +0100
commitcf5b197d150638bdfc7238124965c3c9cf94e899 (patch)
treec31edb545a2266792f18f315fbfd9f3d8a2ffa24
parent4382a204c4a1119e8183129826f21c55cf890c00 (diff)
downloadfisheye-cf5b197d150638bdfc7238124965c3c9cf94e899.tar.gz
fisheye-cf5b197d150638bdfc7238124965c3c9cf94e899.tar.bz2
fisheye-cf5b197d150638bdfc7238124965c3c9cf94e899.zip
Fix breadcrumb hierarchy walk: populate ret directly, skip cross-join verify
When gallery_path is not in the URL (pretty_urls), the fallback now builds $ret directly from per-gallery title lookups instead of relying on the complex multi-table cross-join verify query, which fails silently for paths longer than one level. The complex query is still used when gallery_path arrives via URL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rwxr-xr-xincludes/classes/FisheyeBase.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/includes/classes/FisheyeBase.php b/includes/classes/FisheyeBase.php
index 7b29b18..c73cf3e 100755
--- a/includes/classes/FisheyeBase.php
+++ b/includes/classes/FisheyeBase.php
@@ -159,6 +159,7 @@ not ready for primetime
$ret = [];
if( !$this->getField( 'gallery_path' ) ) {
if( $this->isValid() ) {
+ $ancestors = [];
$pathIds = [];
$currentContentId = $this->mContentId;
for( $depth = 0; $depth < 10; $depth++ ) {
@@ -167,6 +168,7 @@ not ready for primetime
$found = false;
foreach( $parents as $galleryId => $galleryData ) {
if( is_array( $galleryData ) && isset( $galleryData['content_id'] ) ) {
+ $ancestors[] = (int)$galleryId;
array_unshift( $pathIds, $galleryId );
$currentContentId = $galleryData['content_id'];
$found = true;
@@ -177,10 +179,18 @@ not ready for primetime
}
if( $pathIds ) {
$this->setGalleryPath( '/'.implode( '/', $pathIds ) );
+ foreach( array_reverse( $ancestors ) as $gid ) {
+ $ret[$gid] = $this->mDb->getOne(
+ "SELECT lc.`title` FROM `".BIT_DB_PREFIX."liberty_content` lc
+ INNER JOIN `".BIT_DB_PREFIX."fisheye_gallery` fg ON (fg.`content_id`=lc.`content_id`)
+ WHERE fg.`gallery_id`=?",
+ [$gid]
+ );
+ }
}
}
}
- if( $this->getField( 'gallery_path' ) ) {
+ if( !$ret && $this->getField( 'gallery_path' ) ) {
$path = explode( '/', ltrim( $this->getField( 'gallery_path' ), '/' ) );
$p = 0;
$c = 1;