Support » Plugin: BuddyPress Registration Options » wp-multisite/bp-multinetwork plugin queries nonexisting usermata-tables

  • Hi,

    have a WP multisite installation with
    ‘BP multi network’ plugin network-activated
    and Buddypress as a site by site activation.

    Having activated your plugin on a subsite (subdirectory) and going to the ‘members’ or ‘activity’ page, I get this database error message:

    SELECT user_id FROM wp_3_usermeta WHERE meta_key = ‘_bprwg_is_moderated’ AND meta_value = ‘true’ :
    Table ‘mydbase.wp_3_usermeta’ doesn’t exist (where ‘mydbase‘ is a placeholder for the name of my database).

    So somehow it seems to query user(meta) tables for subsites which of course don’t exist.

    Any ideas, what might be wrong? – Is this a misconfiguration of my setup or is ‘bp registration options’ basically not compatible with an ‘BP multi network’ setup?

    Thank you for advice
    Achim

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    I will say it’s mostly our fault, but also one that simply hasn’t come up yet to cause us to need to amend.

    We do use the prefix property on the $wpdb object, where possible, but we don’t do any checks for multisite and if being activated from a subsite. I think it’s the cases where we JUST use the prefix, and not the appropriate dynamically set usermeta table that is causing the problems.

    What I mean by that is $wpdb->prefix . usermeta vs $wpdb->usermeta. We’ll need to amend for a future version but would also be willing to help hotfix/confirm fixed with you to make sure we’re good to go, if you’re willing.

    First of all thank you for your quick response.
    Since my website is in the development stage, I can wait for an update of your Pugin. If the update is not made on time, I will gladly return to your friendly offer.
    Best regards, Achim

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    That would be the proverbial flipside though, as I’m not sure when our next release will be. We’re not actively working on this plugin. That said, you providing some help in testing things now would help make sure a proper fix is found and we can get that patched up in time for the release. It’d also allow you to use the bugfix until then 😀

    Excuse me, it’s me again
    Although I’m not a coding expert and therefore not a wordpress or buddypress expert, I thought again about the problem. And it seems to me that this is not exactly a table-prefix problem, but rather a metafield-prefix problem.
    Since even in a wordpress multisite installation all usermeta data will be saved in only one table ‘wp-usermeta’.
    To differentiate users’ credentials and activities on different sites, there are different meta-fields with different prefixes according to each site (added by wordpress and probably also plugins like buddypress and bp-multi-network). For example, for site / blog 3: wp-3-capabilities, wp-3-userlevel, network-3-last activity (I think from the bp-multi-network plugin) etc. And there’s a metafield called primary_blog, whose field value, like I assume, indicating where you registered (eg: 3).

    So the query should somehow look like this (sorry, I can not code a correct mysql):

    SELECT user_id FROM wp_usermeta WHERE meta_key = 'primary_blog' AND meta_value = '3' AND meta_key = '_bprwg_is_moderated' AND meta_value = 'true'

    Please excuse these wise sayings of a newbee, even more so if all this is nonsense ….

    Best regards, Achim

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Well, I still see having a case of mixing both $wpdb->usermeta and at least one case of $wpdb->prefix . "usermeta..." which is going to potentially cause some unintended mixups.

    I’ll see what I can debug/deduce on my end just in case.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Opened enhancement, just in case anyone wants to follow along.

    https://github.com/WebDevStudios/BuddyPress-Registration-Options/issues/168

    Hi Michael,
    sorry, I missed your last message, it has overlapped with mine.
    A big thank you for your great helpfulness and your tremendous commitment to a free plugin.
    Of course, I’m willing to help you troubleshoot, but the issue is easy to reproduce:
    – Make a fresh wp-multisite install with at least one subsite
    – add define ('BP_ENABLE_MULTIBLOG', true); to the config.php
    – download and network activated ‘pb multi network’ plugin (ATTENTION: its not the one from the wp repository by Ron Rennik, which allows multi multinetworks, but is from Buddydev, which allows one seperate bp network on each site – free download here : https://buddydev.com/plugins/buddypress-multi-network/
    – download buddypress and activate site by site
    – download your bp registration options and activate site by site (with all options set)
    – go to the frontend of a subsite (it only occures on subsites) and
    – click on ‘activities’ menu item and
    POP – the debug message is there!

    I hope that this input may have been useful.
    Best regards and thank you once more!
    Achim

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Update the issue linked above with that information for when I can circle back around to it.

    Hi Michael, just to remind you that I’m still interested in solving the issue… 🙂

    Best Regards
    Achim

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    My biggest question is if you’ve had any new developments on your end, or if you’ve been simply waiting for us to do something. I still haven’t had a chance to circle back around myself, and am not against you doing your own thing with edits to fit your needs. If you’re willing to share any solutions you may come up with, we would be willing to merge those changes and provide credit. Just not sure when I’m going to be able to get back to this still.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘wp-multisite/bp-multinetwork plugin queries nonexisting usermata-tables’ is closed to new replies.