BuddyBoss Home – Web Support Forums Plugins BuddyBoss Media Photo's gone in global media

Viewing 14 posts - 1 through 14 (of 14 total)
  • Question

    #38344
    @haime

    Hi,

    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

    #38350

    Alyssa
    Participant
    @alyssa-buddyboss

    @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?

    #38373
    @haime

    @tjchester I tried both your suggestions. No difference. See http://www.dewaaghalsjes.nl/fotoalbum/

    regards

    #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…

    #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

    #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

    #38467
    @haime

    error 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

    #38470

    Alyssa
    Participant
    @alyssa-buddyboss

    @haime thanks! I’ll have our devs work on this database issue.

    #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 🙂

    #38507

    Alyssa
    Participant
    @alyssa-buddyboss

    @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.

    #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 🙂

    #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

    #38542

    Alyssa
    Participant
    @alyssa-buddyboss

    @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.

    #39852

    Anonymous
    @

    @haime

    We 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.

Viewing 14 posts - 1 through 14 (of 14 total)
  • The question ‘Photo's gone in global media’ is closed to new replies.