Skip to content

Commit a22ee23

Browse files
authored
Merge pull request #432 from moderntribe/release/5.0.4
packaged version 5.0.4
2 parents de7facb + 479e579 commit a22ee23

File tree

7 files changed

+29
-17
lines changed

7 files changed

+29
-17
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [5.0.4]
4+
5+
### Fixed
6+
- Fix import stuck problem on step 6 - Updating Brands
7+
38
## [5.0.3]
49

510
### Fixed
@@ -1894,6 +1899,7 @@
18941899
in fact, reset postdata, so far as Gutenberg 3.2.0 is concerned.
18951900

18961901

1902+
[5.0.4]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.0.3...5.0.4
18971903
[5.0.3]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.0.2...5.0.3
18981904
[5.0.2]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.0.1...5.0.2
18991905
[5.0.1]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.0.0...5.0.1

bigcommerce.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: BigCommerce for WordPress
44
Description: Scale your ecommerce business with WordPress on the front-end and BigCommerce on the back end. Free up server resources from things like catalog management, processing payments, and managing fulfillment logistics.
55
Author: BigCommerce
6-
Version: 5.0.3
6+
Version: 5.0.4
77
Author URI: https://www.bigcommerce.com/wordpress
88
Requires PHP: 7.4.0
99
Text Domain: bigcommerce

build-timestamp.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?php
2-
define('BIGCOMMERCE_ASSETS_BUILD_TIMESTAMP', '5.19.04.03.2023');
2+
define('BIGCOMMERCE_ASSETS_BUILD_TIMESTAMP', '4.43.08.18.2023');

readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: bigcommerce, moderntribe, jbrinley, becomevocal, vincentlistrani,
33
Tags: ecommerce, online store, sell online, storefront, retail, online shop, bigcommerce, big commerce, e-commerce, physical products, buy buttons, commerce, shopping cart, checkout, cart, shop, headless commerce, shipping, payments, fulfillment
44
Requires at least: 5.2
55
Tested up to: 6.0.3
6-
Stable tag: 5.0.3
6+
Stable tag: 5.0.4
77
Requires PHP: 7.4.0
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html

src/BigCommerce/Import/Processors/Brand_Import.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function get_source_data( $cursor = '' ): array {
4646

4747
if ( is_string( $response ) ) {
4848
// Get next portion of brands
49-
$this->get_source_data( $response );
49+
return $this->get_source_data( $response );
5050
}
5151

5252
return array_merge( $response, $this->get_option( self::BRANDS_CHECKPOINT, [] ) );
@@ -77,9 +77,9 @@ protected function get_fallback_terms() {
7777

7878
return $this->batch;
7979
} catch ( \Throwable $e ) {
80-
do_action( 'bigcommerce/import/error', $e->getMessage(), [
81-
'response' => $e->getResponseBody(),
82-
'headers' => $e->getResponseHeaders(),
80+
do_action( 'bigcommerce/log', Error_Log::DEBUG, $e->getMessage(), [
81+
'response' => method_exists( $e, 'getResponseBody' ) ? $e->getResponseBody() : $e->getTraceAsString(),
82+
'headers' => method_exists( $e, 'getResponseHeaders' ) ? $e->getResponseHeaders() : '',
8383
] );
8484

8585
do_action( 'bigcommerce/log', Error_Log::DEBUG, $e->getTraceAsString(), [] );

src/BigCommerce/Import/Processors/Term_Import.php

+15-9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use BigCommerce\Import\Runner\Status;
1212
use BigCommerce\Logging\Error_Log;
1313
use BigCommerce\Taxonomies\Brand\Brand;
14+
use BigCommerce\Taxonomies\Product_Category\Product_Category;
1415

1516
abstract class Term_Import implements Import_Processor {
1617
use No_Cache_Options;
@@ -76,22 +77,27 @@ public function run() {
7677

7778
try {
7879
$terms = $this->get_source_data();
80+
// Fallback to old categories pull
81+
if ( empty( $terms ) && $this->taxonomy() === Product_Category::NAME ) {
82+
$terms = $this->get_fallback_terms();
83+
$rest_fallback = true;
84+
}
7985
} catch ( \Throwable $e ) {
80-
do_action( 'bigcommerce/log', $e->getMessage(), [
81-
'response' => $e->getResponseBody(),
82-
'headers' => $e->getResponseHeaders(),
86+
do_action( 'bigcommerce/log', Error_Log::DEBUG, $e->getMessage(), [
87+
'response' => method_exists( $e, 'getResponseBody' ) ? $e->getResponseBody() : $e->getTraceAsString(),
88+
'headers' => method_exists( $e, 'getResponseHeaders' ) ? $e->getResponseHeaders() : '',
8389
] );
8490

8591
$terms = $this->get_fallback_terms();
8692
$rest_fallback = true;
93+
}
8794

88-
if ( empty( $terms ) ) {
89-
do_action( 'bigcommerce/log', Error_Log::DEBUG, sprintf( __( 'Could not find terms for %s. Wrapping up step and go to the next one', 'bigcommerce' ), $this->taxonomy() ), [] );
90-
$status->set_status( $this->completed_state() );
91-
$this->clear_state();
95+
if ( empty( $terms ) ) {
96+
do_action( 'bigcommerce/log', Error_Log::DEBUG, sprintf( __( 'Could not find terms for %s. Wrapping up step and go to the next one', 'bigcommerce' ), $this->taxonomy() ), [] );
97+
$status->set_status( $this->completed_state() );
98+
$this->clear_state();
9299

93-
return;
94-
}
100+
return;
95101
}
96102

97103
// Allow more HTML in term descriptions than WP default

src/BigCommerce/Plugin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace BigCommerce;
55

66
class Plugin {
7-
const VERSION = '5.0.3';
7+
const VERSION = '5.0.4';
88

99
protected static $_instance;
1010

0 commit comments

Comments
 (0)