CB Gallery 4.0.0 + CB Activity 6.2.0 - all stream photos show "Something Went Wrong!" for regular users after upgradeHello,After upgrading CB Gallery 2.5.1 → 4.0.0 (build.2026.05.28.14.44.54.53cd15d60) and CB Activity 6.1.1 → 6.2.0 (build.2026.04.16.16.44.21.f05970673), every photo attached to activity stream posts is replaced with the "Something Went Wrong!" message. The profile Gallery tab also shows "No media to display." for existing photos. Importantly:
as a Super User / global moderator everything displays fine — only regular users are affected, so the issue is easy to miss when testing as admin.Environment: Joomla 5.4.6, PHP 8.4.18, MariaDB 10.6.24, CB 2.11.0, CB Privacy 7.0.5 (we tested with it both published and unpublished — no difference).I spent some time debugging this and I believe there are two separate problems:
- Migration assigns legacy stream photos to the wrong gallery. Note we migrated from CB Gallery 2.5.1, so the data went through the full migration chain from the oldest supported version. Before the upgrade our stream photos had assets like
Code:
profile.436.uploads
and were referenced from
of activity rows. After the migration the items got
Code:
asset = activity.ACTIVITY_ID
(correct) but
(Profile Gallery) instead of 50 (CB Activity - Activity). Distribution after upgrade: 1051 items with asset
and 83 with
all ended up in gallery 1, while 2 comment photos uploaded after the upgrade correctly got gallery 51. The
Code:
cbactivity_activity
step in install.cbgallery.php sets both columns in one UPDATE (
Code:
WHERE ... AND gallery_id = 0
), so it looks like the items already had a non-zero gallery_id when that step ran, or the step ran twice/partially.
- Even with the correct gallery_id the photos are still denied for non-moderators. I manually set one item to
and it still rendered as "Something Went Wrong!". Following the code: the stream template calls
Code:
GalleryHelper::getMedia()
→
Code:
QueryHelper::verifyAccess()
→
Code:
QueryHelper::canAccess()
, which calls
Code:
$row->getGallery()->canAccess('any')
.
Code:
ItemTable::getGallery()
seeds the gallery data from
Code:
ItemTable::getAsset()
, whose data array only contains
Code:
gallery_id, media_type, media_id, user_id, is_hold
— there is no
. So the system gallery's asset template
Code:
activity.[activity_id]
never gets its placeholder substituted, and
Code:
AssetEntity::canAccess()
starts with
Code:
if ( strpos( $this->asset, '[' ) !== false ) { return false; }[/code] — hard deny. Global moderators return true earlier in that method, which is why admins see the photos. The same applies to gallery 1 ([code]profile.[displayed_id]
) and 51, so effectively every gallery item in streams is hidden from regular users.
For now I restored the site from backup (CB Gallery 2.5.1 / CB Activity 6.1.1) and everything works again, so this is not urgent for me, but I'd like to redo the upgrade once it's safe. Could you:
- confirm whether the stream rendering path is supposed to pass the activity context to the gallery asset (or whether
Code:
AssetEntity::canAccess()
should not hard-fail on unresolved placeholders for system galleries), and
- take a look at the migration mapping for legacy activity/comment photos (gallery_id 1 vs 50/51)?