Not able to vote on Q&A

I am able to test various users with Q&A and the viewing questions and ability to answer appears to be working fine but the vote seems disabled.

  • antKat
    • HummingBird

    The users I had been testing were all logged in and AT THAT TIME they were able to access the Questions page, read and respond to questions but not vote. However, now I just went to test for visitors not logged in and I’m getting a 404 error no matter who tries to access it. I recall a couple of months ago having issues with the install that got worked out. Now we are getting to launch, so I’m retesting everything.

  • antKat
    • HummingBird

    Hi Phil thanks for helping me out. In getting ready to launch in a couple of days, I deleted all of the test Q&A’s . . . I believe this must have caused the 404 error because I added a test question back in and can now access the Q&A. So all that is left to do is figure out the voting. I did determine that I, as the super admin can vote, but not the other logged in users.

    This is a multi-site with the Q&A activated on the main site with links from the top menu of the sub-sites. A sub-site url is: http://www.sportslife.me/sportslifetutorial/ Q&A menu label is “Answers”.

    I’ll remove the coming soon redirect

    Our main site is: Sportslife.me

    Do you need admin access?

  • Philip John
    • DEV MAN’s Apprentice

    Hiya,

    I’ve just tested this myself with a newly registered account and I am able to vote on answers without any issue once logged in.

    Are the other logged in users that are unable to vote registered as users on your main site? If not, they need to be in order to vote.

    Phil

  • antKat
    • HummingBird

    Ughhhh – Our network settings for “Both sites and user accounts can be registered” is not working – the users are only getting registered on their own site and listed in the network. They are supposed to be subscribers on the main site. I wonder what is getting in the way of this registration??? For awhile I was testing the Membership plugin – but deactivated it for now because I want to provide the “Gimme a Site” on Signup. Do you think this may be causing this?

  • Philip John
    • DEV MAN’s Apprentice

    Ah sorry, not I got confused. By default, new users aren’t added to the main blog.

    You’ll need to add a file to mu-plugins with this code in:

    function ds_new_user_meta($blog_id, $user_id) {
    add_user_to_blog('1', $user_id, 'subscriber' );
    }
    add_action( 'wpmu_new_blog', 'ds_new_user_meta', 10, 2 );

    Thanks,

    Phil

  • antKat
    • HummingBird

    Phil, I had to re-open – although maybe this should be in another thread now – but I am responding to your last response and maybe you can help me modify the code. For our multi-site, we have blog owners role being set-up on signup as “Editor” so that we could simplify the dashboard; to do that I already had a MU file that reads as:

    <?php
    function ds_new_user_meta($blog_id, $user_id) {
    add_user_to_blog($blog_id, $user_id, 'editor' );
    }
    add_action( 'wpmu_new_blog', 'ds_new_user_meta', 10, 2 );

    // To change role of user on the blog while it is being created add the following to mu-plugins

    This code had been working quite well. When I add another file as you suggested above with:

    function ds_new_user_meta($blog_id, $user_id) {
    add_user_to_blog('1', $user_id, 'subscriber' );
    }
    add_action( 'wpmu_new_blog', 'ds_new_user_meta', 10, 2 );

    The new users are being registered in main site as subscriber – but they are now admins of their own site rather than Editor. How do I combine these two codes to get subscriber at main site and editor on user site?

  • Philip John
    • DEV MAN’s Apprentice

    Ah okay – that’s because your new file is over-ruling your original. So, delete that new file and change your original file to this;

    function ds_new_user_meta($blog_id, $user_id) {
    add_user_to_blog($blog_id, $user_id, 'editor' ); // make site owner an editor
    add_user_to_blog('1', $user_id, 'subscriber' ); // add site owner to main blog as subscriber
    }
    add_action( 'wpmu_new_blog', 'ds_new_user_meta', 10, 2 );

    That basically takes your original file and adds the bit to make them a subscriber to the main blog as well.

    Phil

  • antKat
    • HummingBird

    Phil, I think we are getting there by a couple of early tests. Now getting back to voting . . .

    Can you vote on a question without providing an answer? The arrow is now active and moves up/down with new user – but if they “submit” they are prompted to add an answer; if they just move the arrow up/down and back out of question, the vote isn’t tabulated. Is this the correct functionality? It seems you may find a good answer and want to vote without creating another answer.

  • antKat
    • HummingBird

    Yes I meant that you could vote by clicking the up or down arrow, which turns color and changes the count – but how do you save the changed count? The “submit” button requires putting in another answer and if you move off the page, the vote did not save.