Skip to content

Commit

Permalink
Fix: Fatal error while updating manually order status. (#59)
Browse files Browse the repository at this point in the history
* Fix the error

* Update readme
  • Loading branch information
vyskoczilova authored Jul 26, 2023
1 parent 7d0fe63 commit 3a82f83
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions includes/filters-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,11 @@ function woolab_icdic_process_shop_order ( $order_id, $order ) {
return;
}

// If not instance of WC_Order, get post ID and create WC_Order (somehow WC_Order is not passed in woocommerce_process_shop_order_meta hook, although it was before).
if ( ! $order instanceof \WC_Order ) {
$order = wc_get_order( $order_id );
}

$update_user_meta = apply_filters( 'woolab_icdic_update_user_meta', false );
$user_id = intval( $_POST['user_ID'] );

Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: vyskoczilova
Tags: woocommerce, DIČ, IČO, IČ, IČ DPH, česky, česká, české, cz, Czech, zobrazení, úprava, VAT, number, Company, identification, tax, eshop, e-shop, ecommerce, e-commerce, commerce, woothemes, wordpress woocommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, additional, fields, variable, download, downloadable, digital, inventory, fakturační, billing, shipping, adresa, address, woo commerce, order, objednávka, admin, backend
Requires at least: 4.6
Tested up to: 6.3
Stable tag: 1.7.0
Stable tag: 1.7.1
Requires PHP: 7.1
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -128,6 +128,10 @@ Either post it on [GitHub](https://github.com/vyskoczilova/kybernaut-ic-dic) or

== Changelog ==

= 1.7.1 (2023-07-26) =

* Fix: Fatal error while updating manually order status [#59](https://github.com/vyskoczilova/kybernaut-ic-dic/pull/59)

= 1.7.0 (2023-07-25) =

* Feature: HPOS support - together with [@morvy](https://github.com/morvy), [#55](https://github.com/vyskoczilova/kybernaut-ic-dic/pull/55)
Expand Down
4 changes: 2 additions & 2 deletions woolab-ic-dic.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Kybernaut IC DIC
Plugin URI: https://kybernaut.cz/pluginy/kybernaut-ic-dic
Description: Adds Czech Company & VAT numbers (IČO & DIČ) to WooCommerce billing fields and verifies if data are correct.
Version: 1.7.0
Version: 1.7.1
Author: Karolína Vyskočilová
Author URI: https://kybernaut.cz
Text Domain: woolab-ic-dic
Expand All @@ -29,7 +29,7 @@
define( 'WOOLAB_IC_DIC_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
define( 'WOOLAB_IC_DIC_ABSPATH', dirname( __FILE__ ) . '/' );
define( 'WOOLAB_IC_DIC_URL', plugin_dir_url( __FILE__ ) );
define( 'WOOLAB_IC_DIC_VERSION', '1.7.0' );
define( 'WOOLAB_IC_DIC_VERSION', '1.7.1' );

// Check if WooCommerce active
function woolab_icdic_init() {
Expand Down

0 comments on commit 3a82f83

Please sign in to comment.