Forums › Forums › Search & Filter Pro › Search cache not updating after WP All Import
Tagged: wp_all_import cache
- This topic has 7 replies, 2 voices, and was last updated 6 years, 7 months ago by
Trevor.
-
Anonymous(Private) October 4, 2018 at 9:52 am #190039
Hello
This I have the following code in functions.php
//Rebuild search and filter pro cache after wp all import add_action('pmxi_saved_post', 'wpai_post_saved', 10, 1); function wpai_post_saved($id) { do_action('search_filter_update_post_cache', $id); } //Reindex relvanssi after wp all import add_action('pmxi_after_xml_import', 'after_xml_import', 10, 1); function after_xml_import($import_id) { relevanssi_build_index(); }
WP All Import runs on a cron job, and so every day we are having to rebuild the cache manually.
What are we doing wrong
Thanks
Trevor(Private) October 4, 2018 at 1:32 pm #190051The only other time I have been asked this question is in this thread, if it is of any help to you:
https://support.searchandfilter.com/forums/topic/wp-all-import-taxonomies-not-updated/
Anonymous(Private) October 10, 2018 at 8:35 am #190589So the action pmxi_saved_post is where search_filter_update_post_cache is called, which from the log appears to be after the taxonomies are imported. However, looking at the terminologies used in the log, WP_All_Import saves posts and imports taxonomies.
Tomorrow I will see whether running search_filter_update_post_cache on the pmxi_after_post_import hook makes any difference.
In the meantime, is there anything else you could suggest please?
Trevor(Private) October 10, 2018 at 9:02 am #190593Do you think it possible that the save process is getting truncated, at or around where the taxonomy data is not being saved?
I wonder is WP does not have enough memory allocated (so, NOT a PHP issue but related to the WP_MEMORY_LIMIT varible (our System Status page should show this, I hope)?
Or maybe PHP Max Input Vars is too low (default is 1000, but I usually have it a lot higher).
Or maybe the SQL query to save is being truncated (some hosts do that, such as WP Engine)?
Anonymous(Private) October 10, 2018 at 1:42 pm #190642Thank you – I think they are all things we’ll need to take a look at.
Also, we are using acf, and the wpai-acf-add-on plugin. I’ve just run the import on my local machine, where I have better debugging, and I can see that the following error is thrown, twice, at the start of the log:
Warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/engage-education-wordpress/wp-content/plugins/wpai-acf-add-on/libraries/acf-fields/fields/fieldTaxonomy.php on line 59
I can see that relates to $taxonomies_hierarchy = json_decode($xpath[‘value’]);
A var_dump of $xpath reveals it to be array(2) { [“value”]=> string(0) “” [“delim”]=> string(1) “,” }
Does this point to maybe something being wrong with how the fields are being mapped in our set up?
-
AuthorPosts