Is anyone having a problem where some users can see the "Support" sidebar menu item &

Ok, at one point (as far as I know) everyone could see the "support" menu on the sidebar. I've set up test users and submitted tickets, and one real user submitted a ticket.

Now, though, my test user can see the "Support" button, but the real users I've logged in as to check can't.

Initially, I had "Pro Sites" installed as well, and I've tried network disabling that.

Unfortunately, I didn't find out fast enough to time-stamp it with one of the updates that came recently, but that's my suspicion. So, I'm wondering if anyone else has seen this happen?

  • Honor

    I don't know if this is a causative part of the issue or not, but it's a correlation.

    Some of these user accounts were created with the "batch create" plugin after their site had already been created and populated, while others were created automatically when their site was created (though the "New Blog Templates" plugin was used).

    In the "test.xls" spreadsheet that is linked in the "batch create" plugin, it says if you leave the "User Role" field blank or insert "null", the user will be created as an administrator - so, that's what was put in there - "null". Well, when the user accounts were created, it didn't give them admin permissions - they got a username and password, but they couldn't log in to administer their site.

    We went in and changed them all to administrators, and changed their nickname and display as, as we assumed that had caused the error, and they could log in fine.

    Fast forward to this current problem. I've noticed that the users whose accounts were created with "batch create" can't see the support section, while the ones created automatically can. Look at a few of them, and I notice that the ones created with "Batch create" have an extra section on their profile -
    Additional Capabilities
    Capabilities: null

    So, I don't know if that could be part of it, and I haven't check every one of the hundred fifty or so created with Batch Create, but it's a thing, so I figured I'd mention it.

    I suppose I could get into PHPMyAdmin and strip that field/row/thing? So they have no "additional capabilities"? Or, if I re-allow the pro-sites role thing, is it part of that?

  • Michelle Shull

    Hi, Honor!

    Sorry for the delay here, this is definitely weird! I think the batch create issue here may be worth taking a closer look at, the capabilities: null is likely the cause of the issue. Removing that column via database sounds a bit like setting the house on fire to kill a spider, however. (Not totally unreasonable, but there may be a better way.)

    Let's ask our SLS team (the next level of support) to take a look here, they're our best mystery solvers. Let's be proactive and have you send in some details, so if they need to look at your database, or access a file via FTP, we can have all the tools they might need at their fingertips.

    https://premium.wpmudev.org/contact/

    Subject: "Attn: Michelle Shull"
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    Select "I have a different question" for your topic - this and the subject line ensure that it gets assigned to me.

    Thanks, Honor!

  • Hoang Ngo

    Hi @Honor,

    I hope you are well today and many thanks for your information.

    I've just checked the Batch Create plugin code, it's look like the plugin can't find the blog, so it's just added the user, but because the user still not add to any blogs, so it's will not have any permissions.

    I can write a small snippet for you, so any users imported by Batch Create will assign to all blogs or the main blog if that ok for you :slight_smile:

    Best regards,
    Hoang

  • Honor

    That's odd...

    When I used it, the blogs already existed, I was just adding users. There's a place in the CSV file to enter the blog name / subdomain each new user is supposed to go with, and It added each user to the correct blog when I used it - if you looked at the users for that blog, it showed them in the right place - it just didn't make them admins. Actually, it gave them no permissions for the existing blogs. They could log in, but when they tried to go to their blog, it told them they didn't have permissions.

    We had to go in to each user account, on their own blog dashboard, and edit their role to "Admin" (we also created a "Nickname" for each, since the security plugin demands login and nickname are different, and Batch Create made them the same. We figured that might have been why it didn't give them admin roles.)

    At this point, though, I don't need Batch Create to work better so much as I need all the users created with Batch Create to be able to see the Support System menu...

  • Honor

    Hi there.
    Sure :slight_smile: Actually, in the Batch Create plugin, the downloaded/installed files include a sample file in both XLS and CSV format - so I downloaded that, took a look, stripped out the first row (with the instructions) and then put in few test users to test it.

    After that worked, I pasted in the appropriate columns of data from a different spreadsheet, exported a CSV version, and used that.

    There were like 160/170 in the original batch create, but I figured the first ten would be enough for you to see the format - if you need the full one, just let me know. :slight_smile:

  • Hoang Ngo

    Hi @Honor,

    I hope you are well today and I'm sorry for the delay.

    I've checked your sample file, sometime, when an user created, but the site is not created successfully or user role not specific, that user will not add to any blogs, that's mean that user will not have any roles too.

    This code below will check if the users has not added to any blog, it will be add to the main blog. Please add this code to your theme functions.php or use mu-plugins

    add_action('batch_create_after_create_user', 'update_role_for_user_batch_create', 10, 2);
    function update_role_for_user_batch_create($queue_id, $user_id)
    {
        $blogs = get_blogs_of_user($user_id);
        if (empty($blogs)) {
            add_user_to_blog(1, $user_id, 'subscriber');
        }
    }

    Let's see if it can help :slight_smile:

    Best regards,
    Hoang

  • Honor

    I think I'm pretty well confused now. :slight_frown:

    The users all have been assigned to the appropriate blogs - that's not the issue. There are blogs that only the superadmin is a member of, but there are no blogs nobody is a member of. All of the blogs in question have both the superadmin and the user created by Batch Create. Some of them weren't able to log in initially, but we've fixed that.

    The issue is that, when they're logged in to their blog, they can't see the Support System menu item.

  • Honor

    Ever have one of those problems where you start to doubt everything you know? I'm having one of those days (Well, with this problem, it's turning into one of those months, and fast.)

    When you say you've checked my logs file... Which is that? And the next question - is a typo, I think? You're asking me to create a test account for you, or you're saying you tested the CSV I sent and it worked fine?

  • Michael Bissett

    Hey @Honor, hope you don't mind me jumping in here in the meantime. :slight_smile:

    To go back to your earlier comment about the user capabilities:

    Fast forward to this current problem. I've noticed that the users whose accounts were created with "batch create" can't see the support section, while the ones created automatically can. Look at a few of them, and I notice that the ones created with "Batch create" have an extra section on their profile -
    Additional Capabilities
    Capabilities: null

    So, I don't know if that could be part of it, and I haven't check every one of the hundred fifty or so created with Batch Create, but it's a thing, so I figured I'd mention it.

    I'd personally want to try taking one of the users created with Batch Create, and use a plugin like this:

    http://wordpress.org/plugins/user-role-editor/

    To remove the "null" capability from the user, and then try logging in as the user. You'd want to go into the subsite for one of the users imported via Batch Create, and then inside of:

    Users -> All Users

    You'll want to click on the "Capabilities" link for the user, you'll be able to edit them from there. :slight_smile:

    If that "null" capability is try what's causing the problem (it seems like it is, so far), then removing that capability should do the trick.

    Could you try doing that please? :slight_smile:

    Kind Regards,
    Michael

  • Honor

    Well, sorry for the long delay, but I did finally get into the issue with this, trying the role editor solution, and it worked.

    Now, since there's no super-admin function for this, and I can't mass-remove that "capability" item - at least not in any way I've found yet - I've got rather a long road ahead, checking each one manually, and removing them as needed, but, at least it's a solution, and it works! :slight_smile:

    It still seems to me that there should be a way to do this in a few keystrokes from the DB admin area, but I'm not a database specialist, so I'm probably mistaken. As it stands, the process is:
    * log into each site as super-admin
    * look at the user for that site
    * click to edit their profile
    * look for the extra "null" capability
    * if there, click to edit
    * unckeck & save
    * move on to the next one...

    If you can think of anything obvious I've missed that's causing me to do this the hard way, let me know? And thank you for the solution. :slight_smile:

  • Michael Bissett

    Hey @Honor, you're welcome, glad the solution's helping you out so far! :slight_smile:

    The trick with the database editing side of things, is that this is what the capabilities entry can look like in the database:

    a:17:{s:13:"administrator";b:1;s:15:"membershipadmin";b:1;s:24:"membershipadmindashboard";b:1;s:22:"membershipadminmembers";b:1;s:21:"membershipadminlevels";b:1;s:28:"membershipadminsubscriptions";b:1;s:22:"membershipadmincoupons";b:1;s:24:"membershipadminpurchases";b:1;s:29:"membershipadmincommunications";b:1;s:21:"membershipadmingroups";b:1;s:20:"membershipadminpings";b:1;s:23:"membershipadmingateways";b:1;s:22:"membershipadminoptions";b:1;s:32:"membershipadminupdatepermissions";b:1;s:18:"create_classifieds";b:1;s:15:"create_listings";b:1;s:13:"bbp_keymaster";b:1;}

    Granted, this is with our Membership plugin thrown in (so it's adding in it's own capabilities), but still, the editing of the database information isn't such a simple affair. I've tried looking for a means of bulk editing this info, but nothing's coming up presently.

    Kind Regards,
    Michael