ElasticPress
ElasticPress copied to clipboard
BUG: Error during the index with Multisite + WooCommerce setup
Describe the bug
An error related to WooCommerce occurred while indexing the multisite through the wp-cli command. It is happening on multisite setup where the ElasticPress is enabled on network wide and WooCommerce is enabled only on selected sites. It seems that it is trying to index the WooCommerce content for the site which don't have the WooCommerce enabled.
Note: It is only happening during the first index call but not every time. (In order to recreate the issue again, just add another site without WooCommerce and run the index command).
Steps to Reproduce
- Enable the ElasticPress on network side.
- Enable WooCommerce for selected sites.
- Enable the WooCommerce option.
- Run the
wp elasticpress index --network-wide
command. - You can see the error while it tries to index the site which don't have the WooCommerce enabled.
Expected behavior
It should index only the WooCommerce posts from the site which has WooCommerce enabled.
Additional context
Error: WordPress database error Table 'elasticpress-woo-test.wp_3_woocommerce_attribute_taxonomies' doesn't exist for query SELECT * FROM wp_3_woocommerce_attribute_taxonomies WHERE attribute_name != '' ORDER BY attribute_name ASC; made by include('phar:///usr/local/bin/wp/php/boot-phar.php'), include('phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php'), WP_CLI\bootstrap, WP_CLI\Bootstrap\LaunchRunner->process, WP_CLI\Runner->start, WP_CLI\Runner->run_command_and_exit, WP_CLI\Runner->run_command, WP_CLI\Dispatcher\Subcommand->invoke, call_user_func, WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}, call_user_func, ElasticPress\Command->index, ElasticPress\IndexHelper->full_index, ElasticPress\IndexHelper->process_sync_item, ElasticPress\IndexHelper->index_objects, ElasticPress\IndexHelper->index_next_batch, ElasticPress\Indexable->bulk_index_dynamically, ElasticPress\Indexable\Post\Post->prepare_document, ElasticPress\Indexable\Post\Post->prepare_terms, ElasticPress\Indexable\Post\Post->get_indexable_post_taxonomies, apply_filters('ep_sync_taxonomies'), WP_Hook->apply_filters, ElasticPress\Feature\WooCommerce\WooCommerce->whitelist_taxonomies, wc_get_attribute_taxonomies