WooCommerce Gutenberg Products Block - Version 2.6.1

Version Description

  • 2020-06-01 =

  • fix: Updated the wc_reserved_stock table for compatibility with versions of MySql < 5.6.5. #2590

Download this release

Release Info

Developer nerrad
Plugin Icon 128x128 WooCommerce Gutenberg Products Block
Version 2.6.1
Comparing to
See all releases

Code changes from version 2.6.0 to 2.6.1

readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
4
  Requires at least: 5.2
5
  Tested up to: 5.4
6
  Requires PHP: 5.6
7
- Stable tag: 2.6.0
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -120,6 +120,10 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/
120
 
121
  == Changelog ==
122
 
 
 
 
 
123
  = 2.6.0 - 2020-05-25 =
124
  **New Blocks**
125
 
4
  Requires at least: 5.2
5
  Tested up to: 5.4
6
  Requires PHP: 5.6
7
+ Stable tag: 2.6.1
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
120
 
121
  == Changelog ==
122
 
123
+ = 2.6.1 - 2020-06-01 =
124
+
125
+ - fix: Updated the wc_reserved_stock table for compatibility with versions of MySql < 5.6.5. [#2590](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2590)
126
+
127
  = 2.6.0 - 2020-05-25 =
128
  **New Blocks**
129
 
src/Installer.php CHANGED
@@ -58,8 +58,8 @@ class Installer {
58
  `order_id` bigint(20) NOT NULL,
59
  `product_id` bigint(20) NOT NULL,
60
  `stock_quantity` double NOT NULL DEFAULT 0,
61
- `timestamp` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
62
- `expires` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
63
  PRIMARY KEY (`order_id`, `product_id`)
64
  ) $collate;
65
  "
58
  `order_id` bigint(20) NOT NULL,
59
  `product_id` bigint(20) NOT NULL,
60
  `stock_quantity` double NOT NULL DEFAULT 0,
61
+ `timestamp` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
62
+ `expires` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
63
  PRIMARY KEY (`order_id`, `product_id`)
64
  ) $collate;
65
  "
src/Package.php CHANGED
@@ -84,7 +84,7 @@ class Package {
84
  NewPackage::class,
85
  function ( $container ) {
86
  // leave for automated version bumping.
87
- $version = '2.6.0';
88
  return new NewPackage(
89
  $version,
90
  dirname( __DIR__ )
84
  NewPackage::class,
85
  function ( $container ) {
86
  // leave for automated version bumping.
87
+ $version = '2.6.1';
88
  return new NewPackage(
89
  $version,
90
  dirname( __DIR__ )
src/StoreApi/Utilities/ReserveStock.php CHANGED
@@ -162,9 +162,10 @@ final class ReserveStock {
162
  $result = $wpdb->query(
163
  $wpdb->prepare(
164
  "
165
- REPLACE INTO {$wpdb->wc_reserved_stock} ( order_id, product_id, stock_quantity, expires )
166
- SELECT %d, %d, %d, ( NOW() + INTERVAL %d MINUTE ) from DUAL
167
  WHERE ( $query_for_stock FOR UPDATE ) - ( $query_for_reserved_stock FOR UPDATE ) >= %d
 
168
  ",
169
  $order->get_id(),
170
  $product_id,
162
  $result = $wpdb->query(
163
  $wpdb->prepare(
164
  "
165
+ INSERT INTO {$wpdb->wc_reserved_stock} ( `order_id`, `product_id`, `stock_quantity`, `timestamp`, `expires` )
166
+ SELECT %d, %d, %d, NOW(), ( NOW() + INTERVAL %d MINUTE ) FROM DUAL
167
  WHERE ( $query_for_stock FOR UPDATE ) - ( $query_for_reserved_stock FOR UPDATE ) >= %d
168
+ ON DUPLICATE KEY UPDATE `expires` = VALUES( `expires` )
169
  ",
170
  $order->get_id(),
171
  $product_id,
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit83b702664031a8f7fef1fdceede20b03::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInite9d25b61d3859814b6f3f397976da043::getLoader();
vendor/autoload_packages.php CHANGED
@@ -178,7 +178,7 @@ if ( ! function_exists( __NAMESPACE__ . '\autoloader' ) ) {
178
  /**
179
  * Prepare all the classes for autoloading.
180
  */
181
- function enqueue_packages_594e447cb17585da8d4d9ea92acd30c3() {
182
  $class_map = require_once dirname( __FILE__ ) . '/composer/autoload_classmap_package.php';
183
  foreach ( $class_map as $class_name => $class_info ) {
184
  enqueue_package_class( $class_name, $class_info['version'], $class_info['path'] );
@@ -202,4 +202,4 @@ function enqueue_packages_594e447cb17585da8d4d9ea92acd30c3() {
202
  file_loader(); // Either WordPress is not loaded or plugin is doing it wrong. Either way we'll load the files so nothing breaks.
203
  }
204
  }
205
- enqueue_packages_594e447cb17585da8d4d9ea92acd30c3();
178
  /**
179
  * Prepare all the classes for autoloading.
180
  */
181
+ function enqueue_packages_57b47e63c61ea261ee316f5871df8ca6() {
182
  $class_map = require_once dirname( __FILE__ ) . '/composer/autoload_classmap_package.php';
183
  foreach ( $class_map as $class_name => $class_info ) {
184
  enqueue_package_class( $class_name, $class_info['version'], $class_info['path'] );
202
  file_loader(); // Either WordPress is not loaded or plugin is doing it wrong. Either way we'll load the files so nothing breaks.
203
  }
204
  }
205
+ enqueue_packages_57b47e63c61ea261ee316f5871df8ca6();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit83b702664031a8f7fef1fdceede20b03
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit83b702664031a8f7fef1fdceede20b03
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit83b702664031a8f7fef1fdceede20b03', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit83b702664031a8f7fef1fdceede20b03', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit83b702664031a8f7fef1fdceede20b03::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInite9d25b61d3859814b6f3f397976da043
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInite9d25b61d3859814b6f3f397976da043', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInite9d25b61d3859814b6f3f397976da043', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInite9d25b61d3859814b6f3f397976da043::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit83b702664031a8f7fef1fdceede20b03
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
@@ -36,8 +36,8 @@ class ComposerStaticInit83b702664031a8f7fef1fdceede20b03
36
  public static function getInitializer(ClassLoader $loader)
37
  {
38
  return \Closure::bind(function () use ($loader) {
39
- $loader->prefixLengthsPsr4 = ComposerStaticInit83b702664031a8f7fef1fdceede20b03::$prefixLengthsPsr4;
40
- $loader->prefixDirsPsr4 = ComposerStaticInit83b702664031a8f7fef1fdceede20b03::$prefixDirsPsr4;
41
 
42
  }, null, ClassLoader::class);
43
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInite9d25b61d3859814b6f3f397976da043
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
36
  public static function getInitializer(ClassLoader $loader)
37
  {
38
  return \Closure::bind(function () use ($loader) {
39
+ $loader->prefixLengthsPsr4 = ComposerStaticInite9d25b61d3859814b6f3f397976da043::$prefixLengthsPsr4;
40
+ $loader->prefixDirsPsr4 = ComposerStaticInite9d25b61d3859814b6f3f397976da043::$prefixDirsPsr4;
41
 
42
  }, null, ClassLoader::class);
43
  }
woocommerce-gutenberg-products-block.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce Blocks
4
  * Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block
5
  * Description: WooCommerce blocks for the Gutenberg editor.
6
- * Version: 2.6.0
7
  * Author: Automattic
8
  * Author URI: https://woocommerce.com
9
  * Text Domain: woo-gutenberg-products-block
3
  * Plugin Name: WooCommerce Blocks
4
  * Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block
5
  * Description: WooCommerce blocks for the Gutenberg editor.
6
+ * Version: 2.6.1
7
  * Author: Automattic
8
  * Author URI: https://woocommerce.com
9
  * Text Domain: woo-gutenberg-products-block