Channel_Not_Found_Exception “Primary channel is not set”
-
Description
A fresh install of WordPress 5.8 with only the BigCommerce WP plugin throws the Channel_Not_Found_Exception. The message in the exception is “Primary channel is not set” and is thrown from the \BigCommerce\Taxonomies\Channel\Connections::primary function. The exception is thrown while looking for a taxonomy term “bigcommerce_channel”.Image of exception: https://ibb.co/SKsmXCF
Exception
Fatal error: Uncaught BigCommerce\Exceptions\Channel_Not_Found_Exception: Primary channel is not set. in /opt/app/wp-content/plugins/bigcommerce/src/BigCommerce/Taxonomies/Channel/Connections.php:28 Stack trace: #0 /opt/app/wp-content/plugins/bigcommerce/src/BigCommerce/Taxonomies/Channel/Connections.php(40): BigCommerce\Taxonomies\Channel\Connections->primary() #1 /opt/app/wp-content/plugins/bigcommerce/src/BigCommerce/Taxonomies/Channel/BC_Status.php(71): BigCommerce\Taxonomies\Channel\Connections->current() #2 /opt/app/wp-content/plugins/bigcommerce/src/BigCommerce/Taxonomies/Channel/BC_Status.php(41): BigCommerce\Taxonomies\Channel\BC_Status->get_current_channel_status() #3 /opt/app/wp-content/plugins/bigcommerce/src/BigCommerce/Container/Taxonomies.php(162): BigCommerce\Taxonomies\Channel\BC_Status->admin_notices() #4 /opt/app/wp-includes/class-wp-hook.php(303): BigCommerce\Container\Taxonomies->BigCommerce\Container\{closure}('') #5 /opt/app/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) #6 /opt/app/wp-includes/plugin.php(470): WP_Hook->do_action(Array) #7 /opt/app/wp-admin/admin-header.php(287): do_action('admin_notices') #8 /opt/app/wp-admin/admin.php(239): require_once('/opt/app/wp-adm...') #9 /opt/app/wp-admin/edit.php(10): require_once('/opt/app/wp-adm...') #10 {main} thrown in /opt/app/wp-content/plugins/bigcommerce/src/BigCommerce/Taxonomies/Channel/Connections.php on line 28
This exception is thrown the moment the bigcommerce plugin is added to the WordPress site. There was no chance for configuration as presented in the install guides (see below).
$terms = get_terms( [ 'taxonomy' => Channel::NAME, 'meta_query' => [ [ 'key' => Channel::STATUS, 'value' => Channel::STATUS_PRIMARY, ], ], 'hide_empty' => false, 'number' => 1, ] );
Environment:
Local Dev environment
Alpine Linux
PHP: 8.0.8
MySQL: 5.7
WordPress: 5.8
Multisite (network)
URL: /wp-admin/edit.php?post_type=bigcommerce_product&page=bigcommerce_channelReferences followed:
https://developer.bigcommerce.com/bigcommerce-for-wordpress/getting-started/install
https://developer.bigcommerce.com/bigcommerce-for-wordpress/setup/multi-site
- The topic ‘Channel_Not_Found_Exception “Primary channel is not set”’ is closed to new replies.