Skip to Content Skip to Menu

CB Gallery 4.0.0 + CB Activity 6.2.0 - Something Went Wrong!"

  • robster80
  • robster80
  • ONLINE
  • Posts: 58
  • Thanks: 5
  • Karma: 0
2 hours 41 minutes ago #344111 by robster80
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:
  1. 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
    Code:
    params.gallery
    of activity rows. After the migration the items got
    Code:
    asset = activity.ACTIVITY_ID
    (correct) but
    Code:
    gallery_id = 1
    (Profile Gallery) instead of 50 (CB Activity - Activity). Distribution after upgrade: 1051 items with asset
    Code:
    activity.%
    and 83 with
    Code:
    comment.%
    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.
  2. Even with the correct gallery_id the photos are still denied for non-moderators. I manually set one item to
    Code:
    gallery_id = 50
    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
    Code:
    activity_id
    . 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:
  1. 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
  2. take a look at the migration mapping for legacy activity/comment photos (gallery_id 1 vs 50/51)?

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum