Skip to Content Skip to Menu

🏖 Mid-Summer sale is here! Get 20% off professional and developer memberships with code SUMMER-2026!

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

  • robster80
  • robster80
  • OFFLINE
  • Posts: 58
  • Thanks: 5
  • Karma: 0
1 month 2 weeks ago - 1 month 2 weeks 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 upgrade

Hello,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 profile.436.uploads and were referenced from params.gallery of activity rows. After the migration the items got asset = activity.ACTIVITY_ID (correct) but gallery_id = 1 (Profile Gallery) instead of 50 (CB Activity - Activity). Distribution after upgrade: 1051 items with asset activity.% and 83 with comment.% all ended up in gallery 1, while 2 comment photos uploaded after the upgrade correctly got gallery 51. The cbactivity_activity step in install.cbgallery.php sets both columns in one UPDATE (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 gallery_id = 50and it still rendered as "Something Went Wrong!". Following the code: the stream template calls GalleryHelper::getMedia() → QueryHelper::verifyAccess() → QueryHelper::canAccess(), which calls $row->getGallery()->canAccess('any'). ItemTable::getGallery() seeds the gallery data from ItemTable::getAsset(), whose data array only contains gallery_id, media_type, media_id, user_id, is_hold — there is no activity_id. So the system gallery's asset template activity.[activity_id] never gets its placeholder substituted, and AssetEntity::canAccess() starts with if ( strpos( $this->asset, ') 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 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)?
Last edit: 1 month 2 weeks ago by robster80.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 50620
  • Thanks: 8673
  • Karma: 1474
1 month 2 weeks ago #344112 by krileon

as a Super User / global moderator everything displays fine — only regular users are affected

This means you've an access permission problem somewhere. Either with the gallery the media is on, the media itself, or the album of the media if it's in an album. Check the gallery access within CB Gallery > Galleries then the Media access within CB Gallery > Media.

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

It's possible for some of the migrations to fail. It's not perfect as it can't account for every installs setup. Will review the activity media migration code and see if any fixes are necessary.

As for how to fix this simply navigate to CB Gallery > Media and use the Batch Tools to fix any orphaned media or fix their galleries. The search tools there can be used to narrow down and easily batch apply changes.

Even with the correct gallery_id the photos are still denied for non-moderators.

Within CB Activity > Streams > Activity be sure the gallery for your streams is also set correctly. They all should be set to "CB Activity - Activity" for activity streams and if allowing media in comments then comment streams should have their gallery set to "CB Activity - Comments".


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

Moderators: beatnantkrileon
Powered by Kunena Forum