WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
[resolved] Error rebuilding index after upgrading to 3.0.1 (9 posts)

  1. Agnes
    Member
    Posted 1 year ago #

    I am on WP 3.4.1 (after updating a couple of times), Relevanssi 2.9.14 was working fine before (not sure with which version), I just updated to with 3.0.1 and I get empty results. When I try rebuild the index (and on other instances in the admin, like when uploading an image) it says:
    ‘Warning: Cannot use a scalar value as an array in …/wp-content/plugins/relevanssi/lib/indexing.php on line 294′

    I tried and checked:
    - desactivating/reactivating the plugin,
    - clearing cache (I use 'DB cache reloaded fix') and disabling the cache plugin
    - emptying wp_relevanssi_log and cache tables
    - I dont have query_posts’ in my search page
    - the wp_relevanssi_log table seems to have all tables...
    incl. IP column

    I checked the code in issue and it is the line 'isset' below

    if (count($titles) > 0) {
    			foreach ($titles as $title => $count) {
    				if (strlen($title) < 2) continue;
    				$n++;
    				isset($insert_data[$title]['title']) ? $insert_data[$title]['title'] += $count : $insert_data[$title]['title'] = $count;
    			}
    		}
    	}

    I dont want to delete the plugin and reinstall, because I had a lot of options there...

    Any idea?

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

  2. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    Hmm, sounds like a bug. I don't quite understand how it's possible to get such an error message... Could you please put

    var_dump($insert_data);

    before the $index_titles = true; line slightly above the problematic part and report to me what you see when you try to index? That would help a lot.

  3. Agnes
    Member
    Posted 1 year ago #

    Thanks for the support.

    I did insert this both on local and online sites.
    I then get the following (many times)

    int(0)
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 297
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 297
    
    Warning: Invalid argument supplied for foreach() in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 352
    int(0)
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 297
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 297
    
    Warning: Invalid argument supplied for foreach() in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 352
    int(0)
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 297
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 297
    
    Warning: Invalid argument supplied for foreach() in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 352
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 266
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 266
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 266
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 266
    int(0)
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 297
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 297
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 343
    
    Warning: Invalid argument supplied for foreach() in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 352
    int(0)

    I am trying to think what specific on my site may be... there are many things, but...
    - I have a different table prefix thansk Better-WP security - but it sems the new columns in tables did get in...
    - I use a customized version of Lifestyle theme from Themefuse, that has some content filters. I also use Ultimate TinyMCE....
    - I use many plugins... I desactivated them all, and still get the error
    - I am on a utf-8 db...

    Any more clue? or question I could figure out?

  4. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks. Nothing you listed should be a problem: Relevanssi gets the prefix from WP, the theme shouldn't have anything to do with indexing and Relevanssi works best with UTF-8.

    I have absolutely no idea how $insert_data can be an integer. It is defined as an array, and treated as such.

    Please add a couple of more of those var_dump($insert_data); lines, before the following lines:

    196:
    //Added by OdditY - INDEX COMMENTS of the POST ->

    234:
    // Then process all taxonomies, if any.

    249:
    if ($custom_fields) {

    282:
    if (function_exists('relevanssi_index_mysql_columns')) {

    At some of these points the array will become an integer. But where?

  5. Agnes
    Member
    Posted 1 year ago #

    mmmm... I did it, but not sure the result will help....

    I get a huge list of errors, here is the beginning:

    array(0) { } array(0) { } int(0) int(0) int(0)
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 308
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 308
    
    Warning: Invalid argument supplied for foreach() in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 363
    array(0) { } array(0) { } int(0) int(0) int(0)
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 308
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 308
    
    Warning: Invalid argument supplied for foreach() in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 363
    array(0) { } array(0) { } int(0) int(0) int(0)
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 308
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 308
    
    Warning: Invalid argument supplied for foreach() in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 363
    array(0) { } array(0) { } int(0)
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 274
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 274
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 274
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 274
    int(0) int(0)
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 308
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 308
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 354
    
    Warning: Cannot use a scalar value as an array in /home/morija/public_html/wp-content/plugins/relevanssi/lib/indexing.php on line 354

    Then it says 'Indexing complete!' but the index remains empty.
    I tried limiting the index to posts, and it is still the same. To pages: same thing. I also have various custom post types.
    I wonder if I should try with an earlier version of my DB, if it is something connected with the content... But how comes it happens so many times!?

    I guess I will revert to the older version of Relevanssi, unless you have new ideas I could checK?
    I like beeing able to update plugins:)

  6. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    Yes! Thanks! That was all I needed. I found the bug in the code. I'll be able to release a fixed version, I'll try to get one out later today. Thank you for your patience and help!

  7. Agnes
    Member
    Posted 1 year ago #

    That is great!
    If you think it comes soon (within the week), I'll avoid downgrading and will be able upgrade!
    I realy wonder how I was the only one to see such bug §-]

  8. Agnes
    Member
    Posted 1 year ago #

    PS: thanks for the great support :)

  9. Agnes
    Member
    Posted 1 year ago #

    I have upgraded and it all works fine :)
    Thanks a lot, Agnes

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags