Support » Plugin: Relevanssi - A Better Search » Error when adding new user.

  • Resolved robRalston1

    (@robralston1)


    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/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mikko Saari

    (@msaari)

    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.

    robRalston1

    (@robralston1)

    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

    Plugin Author Mikko Saari

    (@msaari)

    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.

    robRalston1

    (@robralston1)

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error when adding new user.’ is closed to new replies.