• Resolved mclaurent

    (@mclaurent)


    Hi

    I noticed that when creating content with the new Gutenberg editor I am unable to save posts while Relevanssi is enabled. The error occurs when the AJAX save is triggered and only produces when no taxonomies are set to be indexed (i.e. the default setting).
    Here is the trace of the error:
    Warning: Invalid argument supplied for foreach() in /wp-content/plugins/relevanssi/lib/indexing.php on line <i>393</i></th></tr>

    The issue seems to be that the setting “relevanssi_index_taxonomies_list” is not set in the DB yet, so a simple empty() test solve the issue.

    indexing.php at line 391

    
    if (!empty($taxonomies)){
    	// Then process all taxonomies, if any.
    	foreach ($taxonomies as $taxonomy) {
    		if ($debug) relevanssi_debug_echo("Indexing taxonomy terms for $taxonomy");
    		$insert_data = relevanssi_index_taxonomy_terms($post, $taxonomy, $insert_data);
    	}
    }
    

    Cheers

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

    (@msaari)

    This is an oversight in the Relevanssi install process: the default value for the option is not set. If you go save Relevanssi indexing settings, this error should go away. Am I right?

    I’ll make sure the next version of Relevanssi sets the default value for this option (looks like I had accidentally moved the default value setting to Premium install function; I’ll just move it back).

    Thread Starter mclaurent

    (@mclaurent)

    I have tried this but it didn’t fix it. Then again I did not select any taxonomies to be indexed. Maybe when I select a taxonomy and then save the settings it will work?
    Thanks

    Plugin Author Mikko Saari

    (@msaari)

    Weird. I just tried it: deleted the option, saved the indexing settings, and the empty option appeared in the database.

    But yeah, you can try saving the option with a value, then deselecting the value and saving it again.

    In any case this should be fixed in the next version, as the option will be initialized.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cannot save posts with Gutenberg editor’ is closed to new replies.