Albums are not showing under Albums tab. Photos not showing under Photos tab


I have 2 albums listed in my group but when I click on the albums tab it says there is no media. The pictures that were added to the one album are there and visible under the media tab “All” and can be clicked on to view… but they are not visible under the tab “Photos” and there are nor “Albums” either. I am not sure if this is since I updated RT Media or RT Media Pro a few days ago… but this was working a little while back

Any ideas?

You can take a look here:

and here:

It is doing the same for all groups



I have just noticed that the top level groups are showing albums and photos correctly but it is the sub groups that are not. It looks like the wrong URL is being generated for the sub groups www.xxxxx/media/album/ and .../photo and .../document which is bringing up a page saying "no media found". The sub groups are being treated as a root group in the url (the parent groups are being left out of the url).

Any suggestions on where I can fix this url call? I am using rtMedia Pro v2.1.2 the BP Group Hierarchy plugin.

As I said, this was working previously... so may have something to do with a bug in the update or could be something I have done on my side but don't know where to fix it.



I have managed to fix this in the core, but not very eloquently as I am a bit new to php.

This is what I have done:

Inside RTMedia.php

I replaces the get original_rtmedia_group_link function:

line 1010

function get_rtmedia_group_link($group_id) { $group = groups_get_group(array('group_id' => $group_id)); return home_url(trailingslashit(bp_get_groups_root_slug()) . $group->slug); }

with this:

function get_rtmedia_group_link($group_id) { $group = ""; return home_url(trailingslashit(bp_get_groups_root_slug()) . (bp_get_current_group_slug()) . $group->slug); }

Please advise on if this is ok or if it will break something else? And if there is a better way of writing this. Should I be doing this in the child theme somewhere rather? Can I put it in the function.php rather?

@Elizabeth-Anne, I'm not sure where it breaks, may be shortcode gallery where you specifically show group media as it isn't group page and not current group.

Use trailingslashit(bp_get_current_group_slug()) instead of just bp_get_current_group_slug()

It is not good practice to directly change plugin files as all the changes will be overridden in next plugin update.

We had added a filter for this group link and will be reflected in next release, then you can use that filter and change the URL for groups. Yes, you can add that filter in your theme's functions.php but not this current solution that you had found out.