The MU forums have moved to WordPress.org

Problem with Invites (2 posts)

  1. sixty6
    Member
    Posted 20 years ago #

    Just so you guys know, you are doing an amazing job fixing all the bugs! I just found one in the Invites section:
    Warning: Variable passed to each() is not an array or object in /home/s6blogs/public_html/wp-inst/wp-content/mu-plugins/invites.php on line 312

    Keep up the good work! It would be helpful if you could post here when you fixed this bug and released a stable/unstable version of it! Thanks!

  2. Rafal
    Member
    Posted 20 years ago #

    Hi sixty6.
    I have probably the same problem.

    "Warning: Variable passed to each() ..."
    you see when no user have any invites. If you set some number of invites manually, there aren't any warnigns.

    But this isn't the main problem. I think that when new user is added, there aren't set automatically number of invites left. When user has no invites left (not set any value), in file wp-admin/invites.php you get info: "Sorry, you have used all your invites!".

    In file wp-includes/functions.php at line 2221 is
    "function get_usermeta( $user_id, $meta_key = '')"
    It probably don't get numbers of invites.

    When you run
    "update_usermeta( $user_ID, "invites_left", $invites_left );"
    in invites.php, number of invites is saved and you can get number by get_usermeta.

    When you replace in wp-admin/invites.php (my version 2006-04-26) line 8
    $invites_left = get_usermeta( $user_ID, 'invites_left' );
    by for example
    $invites_left = '10';
    (or any number)
    it will be working. But this is one problem... Numer of invites is unlimited.

    If it still not working you can delete lines in the same file:
    103 -> if( $invites_left != false [...]
    141 to 147 -> check for invites/is_site_admin()

    I have solved my problem in this way, but I know it isn't very good. On my WPMU users can register only by invites.

    I hope that it helps someone and I hope you understand what I wrote (my english is not perfect).

    Rafal.

About this Topic