WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Error rebuilding index after upgrading to 3.0.1

[Resolved] Error rebuilding index after upgrading to 3.0.1

  • Agnes
    Participant

    @agneslesagegmailcom

    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/

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

    @msaari

    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.

    Agnes
    Participant

    @agneslesagegmailcom

    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?

    Plugin Author Mikko Saari
    Participant

    @msaari

    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?

    Agnes
    Participant

    @agneslesagegmailcom

    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:)

    Plugin Author Mikko Saari
    Participant

    @msaari

    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!

    Agnes
    Participant

    @agneslesagegmailcom

    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 §-]

    Agnes
    Participant

    @agneslesagegmailcom

    PS: thanks for the great support 🙂

    Agnes
    Participant

    @agneslesagegmailcom

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] Error rebuilding index after upgrading to 3.0.1’ is closed to new replies.