BuddyBoss Home – Web › Support Forums › Plugins › BuddyBoss Media › Photo's gone in global media
Tagged: global photo page
- This topic has 13 replies, 3 contibutors, and was last updated 9 years, 6 months ago by Anonymous.
Question
April 1, 2015 at 8:00 am #38344@haimeHi,
since the upgrade to BBMedia 3.2 all photo’s have gone from the global media page. I can see them in All Albums but All Photo’s says “No photo’s available”…
please help 🙁
Answers
April 1, 2015 at 9:31 am #38350@alyssa-buddyboss
AlyssaParticipant@haime I was unable to reproduce these results. I have the new version 3.0.2. Perhaps you can try changing the page to something else, save it, then switch it back and see if that helps. I know nothing has changed but can you humor me and disable plugins and check for a conflict?
April 1, 2015 at 10:37 am #38373@haime@tjchester I tried both your suggestions. No difference. See http://www.dewaaghalsjes.nl/fotoalbum/
regards
April 1, 2015 at 2:06 pm #38384@haime@tjchester
I downgraded to 3.0.1 now because on my test site (http://test3.croeze.net/fotoalbum/) that one works. Unfortunately on live the downgrade does not help either…
April 2, 2015 at 4:43 pm #38452@haime@tjchester I think I found the problem. I deleted about 100 of the last posted photo’s from activity (and from the media library ( 🙁 because deleting from activity does not delete the actual attachment…) and then the global media page was working again.
I do think it is a bug in the global media code though because in profile and in activity it did show all the photo’s and only on the global media page i got the “No photo’s found” message…
Anyway, busy now placing all my albums back online…
regards
April 3, 2015 at 4:00 am #38457@haime@tjchester I found the bug and it is a nasty one 🙁
I have exactly 1000 photo’s uploaded on my site (990 visible and 10 deleted from activity by users but still in attachment table). As soon as I add photo number 1001 (I tried with several photo’s to be sure that it was not because the photo itself was corrupted) my global media page will not display photo’s anymore and will say “Sorry, there were no photos found.”
As soon as I remove photo number 1001 I can see the global media page again populated with photo’s
April 3, 2015 at 8:01 am #38467@haimeerror with debug set to true:
WordPress database error: [The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay] SELECT DISTINCT a.id FROM 0_bp_activity a INNER JOIN 0_bp_activity_meta ON ( a.id = 0_bp_activity_meta.activity_id ) INNER JOIN 0_bp_activity_meta AS mt1 ON ( a.id = mt1.activity_id ) INNER JOIN 0_bp_activity_meta AS mt2 ON ( a.id = mt2.activity_id ) LEFT JOIN 0_bp_activity_meta AS bbamt ON (a.id = bbamt.activity_id AND bbamt.meta_key = ‘buddyboss_media_album_id’) WHERE a.is_spam = 0 AND a.hide_sitewide = 0 AND ( 0_bp_activity_meta.meta_key = ‘buddyboss_media_aid’ OR mt1.meta_key = ‘buddyboss_pics_aid’ OR mt2.meta_key = ‘bboss_pics_aid’ ) AND a.type NOT IN (‘activity_comment’, ‘last_activity’) AND (bbamt.activity_id IS NULL OR bbamt.meta_value IN ( 1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18)) ORDER BY a.date_recorded DESC LIMIT 0, 21
April 3, 2015 at 8:51 am #38470April 3, 2015 at 9:00 am #38475@haime@tjchester if in the meanwhile they can guide me how to add SET OPTION SQL_BIG_SELECTS = 1 to the sql statements in /includes/media-functions.php as a quick temporary fix I would be eternally grateful 🙂
April 4, 2015 at 9:32 am #38507@alyssa-buddyboss
AlyssaParticipant@haime try adding this on line 117 and 142
$wpdb->query('SET OPTION SQL_BIG_SELECTS = 1');
If that doesn’t work we’ll need to wait for the devs to come up with a solution.April 4, 2015 at 3:29 pm #38521@haime@tjchester unfortunately it did not work. This is what I did:
line 117 and further:
$wpdb->query('SET OPTION SQL_BIG_SELECTS = 1'); return "SELECT COUNT(*) FROM $activity_table a INNER JOIN $activity_meta_table am ON a.id = am.activity_id LEFT JOIN (SELECT id FROM $groups_table WHERE status != 'public' ) grp ON a.item_id = grp.id WHERE 1=1 AND (am.meta_key = 'buddyboss_media_aid' OR am.meta_key = 'buddyboss_pics_aid' OR am.meta_key = 'bboss_pics_aid') AND (a.component != 'groups' || a.item_id != grp.id)";
and line 142 and further:
$wpdb->query('SET OPTION SQL_BIG_SELECTS = 1'); return "SELECT a.*, am.meta_value FROM $activity_table a INNER JOIN $activity_meta_table am ON a.id = am.activity_id LEFT JOIN (SELECT id FROM $groups_table WHERE status != 'public' ) grp ON a.item_id = grp.id WHERE 1=1 AND (am.meta_key = 'buddyboss_media_aid' OR am.meta_key = 'buddyboss_pics_aid' OR am.meta_key = 'bboss_pics_aid') AND (a.component != 'groups' || a.item_id != grp.id) ORDER BY a.date_recorded DESC";
I’ll wait for the solution of the devs.
If I may suggest:
make an alternative All Albums page the default selected with album links to Album page similar to All Photo’s but then limited to album photo’s only?
regards 🙂
April 4, 2015 at 3:45 pm #38522@haime@tjchester I solved it! 🙂
I added a new function at the top on media-functions.php (and deleted the lines you suggested)
function bbmedia_allow_large_joins() { global $wpdb; $wpdb->query('SET SQL_BIG_SELECTS=1'); } add_action('init', 'bbmedia_allow_large_joins');
anyway, if devs can implement something like what I suggested above would be much better. I see this a temporary fix 🙂
regards
April 5, 2015 at 8:09 pm #38542@alyssa-buddyboss
AlyssaParticipant@haime I think that will hog too much memory since this will apply to every single query. I think I needed to get global $wpdb in the above code I sent you to work. I’m sure the dev will know what to do.
May 5, 2015 at 9:53 pm #39852@
AnonymousWe cannot replicate the issue locally, however it seems you are facing MAX_JOIN_SIZE rows issue so we added fix for that for next release.
- The question ‘Photo's gone in global media’ is closed to new replies.