WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
[resolved] Error when adding new user. (5 posts)

  1. robRalston1
    Member
    Posted 1 year ago #

    Hey,

    I recently updated to the latest version of Relevanssi and now get an error when saving a new user details. error below.

    Warning: Invalid argument supplied for foreach() in /home/public_html/ss_staging/wp-content/plugins/relevanssi/lib/indexing.php on line 260
    
    Warning: Invalid argument supplied for foreach() in /home/public_html/ss_staging/wp-content/plugins/relevanssi/lib/indexing.php on line 260
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/ss_staging/wp-content/plugins/relevanssi/lib/indexing.php:260) in /home/public_html/ss_staging/wp-includes/pluggable.php on line 881

    any ideas whats causing this? thanks

    http://wordpress.org/extend/plugins/relevanssi/

  2. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    User details? Hmm... that line is for custom fields, I'm not sure why your users should have custom fields. Anyway, this will probably be fixed in the next version, I'm going to do something about this bit of code for other reasons and those changes should fix this as well.

  3. robRalston1
    Member
    Posted 1 year ago #

    Sorry but any word when this issue will be fixed? thanks Mikko

    I get those warnings when I try to add a new user. I have a function which creates a new post when a new user is created. the functions below. maybe this is causing the issue?

    any ideas?

    function newProfilePost($user_id){
        $the_user = get_userdata($user_id);
        $new_user_name = $the_user->first_name . ' ' . $the_user->last_name;
        $my_post = array();
        $my_post['post_title'] = $new_user_name;
        $my_post['post_type'] = 'people';
        $my_post['post_content'] = 'Please write your bio information before publishing.';
        $my_post['post_status'] = 'draft';
        $my_post['post_author']  = $user_id;
        wp_insert_post( $my_post );
    }
    add_action('user_register', 'newProfilePost');

    thanks

  4. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, that function of yours is causing this problem. What's wrong with it, I don't know, but that sure explains why Relevanssi would be complaining about custom fields.

    Anyway, this will be fixed in the next version, but how long it takes before the next version is out, I don't know - I've been very busy with my day job.

    If you want a fix now, find the

    foreach ($custom_fields as $field) {

    in lib/indexing.php on line 260, and wrap it in a

    if (is_array($custom_fields)) {

    conditional.

  5. robRalston1
    Member
    Posted 1 year ago #

    Thanks so much for helping me out! your advice work.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic