WordPress.org

Ready to get started?Download WordPress

Forums

WP Bulletin Board
[resolved] How to resolve this Warning: Missing argument 2 for wpbb_user_currentvis (4 posts)

  1. ricoism
    Member
    Posted 1 year ago #

    I have just installed this and this is the warning message across the top of my sight.
    How can this be resolved???

    Warning: Missing argument 2 for wpbb_user_currentvisit() in /public_html/home/xxxxxxxx.xxx/wp-content/plugins/wp-bulletin-board/php/admin/wpbb-admin-functions.php on line 180

    I've looked at the file line reference 180-186 and it is this:
    function wpbb_user_currentvisit($user_login = NULL, $user) {
    /**
    * @todo ... Replace WP_User object with user_id (int)
    */
    $date = date("Y-m-d H:i:s");
    $update_user_currentvisit = update_user_meta($user->ID, 'wpbb_currentvisit', $date);
    }

    http://wordpress.org/extend/plugins/wp-bulletin-board/

  2. codebycarter
    Member
    Plugin Author

    Posted 1 year ago #

    Hey,

    This shouldn't happen and seems to be returning an error instead of a WP_User object so you can replace the function with the code which just performs more checks before doing anything and won't display an error but you will need to check the field "wpbb_currentvisit" in "wp_usermeta" (replacing wp with your database prefix if you're using one) is updating succesfully.

    function wpbb_user_currentvisit($user_login = NULL, $user) {
    	if (func_num_args() >= 1) {
    		$date = date("Y-m-d H:i:s");
    		if ($user) {
    			$user_id = $user->ID;
    		} elseif ($user_login) {
    			// Attempt to get user ID from username
    			$user = get_user_by('login', $user_login);
    			$user_id = $user->ID;
    		}
    		$update_user_currentvisit = update_user_meta($user_id, 'wpbb_currentvisit', $date);
    	}
    }

    Please let me know if you don't understand anything, questions, problems, etc.

    Thanks :)

  3. ricoism
    Member
    Posted 1 year ago #

    Ok,
    so I copied this over the other, updated the database prefix, but still received an error, updated the database prefix ("wpbb_currentvisit" in "wp_usermeta"), uninstalled and reinstalled and still the same:

    Warning: Missing argument 2 for wpbb_user_currentvisit() in /public_html/home/xxxxxxxx.xxx/wp-content/plugins/wp-bulletin-board/php/admin/wpbb-admin-functions.php on line 180

    Note: I am on a multi-site setup and have attempted activating plugin from a single site and from the main network site and still same result..

    Question: What is actually meant by this ("so you can replace the function with the code")?

    I may have missed something, Thanks for checking back to resolve this.

  4. codebycarter
    Member
    Plugin Author

    Posted 1 year ago #

    Would you be able to give me access to a temporary admin account on the non-multisite WordPress site so I could take a look (because if it's multisite, has to be network admin to view the plugins files). You can email it to me at me@codebycarter.com

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.