From be9f09f2171432fb7341f3c1b8838b2637b32624 Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Thu, 30 Mar 2023 09:51:44 +0800 Subject: [PATCH] Fix missing result prop in `wcadmin_install_plugin_error` track (#37466) * Fix missing result prop in install_plugin_error track * Add changelog --- plugins/woocommerce/changelog/fix-install-plugin-error-track | 4 ++++ plugins/woocommerce/src/Admin/PluginsHelper.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 plugins/woocommerce/changelog/fix-install-plugin-error-track diff --git a/plugins/woocommerce/changelog/fix-install-plugin-error-track b/plugins/woocommerce/changelog/fix-install-plugin-error-track new file mode 100644 index 00000000000..9be0defc8d8 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-install-plugin-error-track @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Fix missing result prop in wcadmin_install_plugin_error track diff --git a/plugins/woocommerce/src/Admin/PluginsHelper.php b/plugins/woocommerce/src/Admin/PluginsHelper.php index c333980947e..3f9e41a380a 100644 --- a/plugins/woocommerce/src/Admin/PluginsHelper.php +++ b/plugins/woocommerce/src/Admin/PluginsHelper.php @@ -234,7 +234,7 @@ class PluginsHelper { 'api_version' => $api->version, 'api_download_link' => $api->download_link, 'upgrader_skin_message' => implode( ',', $upgrader->skin->get_upgrade_messages() ), - 'result' => $result, + 'result' => is_wp_error( $result ) ? $result->get_error_message() : 'null', ); wc_admin_record_tracks_event( 'install_plugin_error', $properties );