Load the page controller functions file first to prevent fatal errors when disabling WooCommerce Admin (https://github.com/woocommerce/woocommerce-admin/pull/6710)

* Load the page controller functions file first to prevent fatal errors when disabling WooCommerce Admin

* Add changelog

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
This commit is contained in:
Hsing-yu Flowers 2021-04-15 21:59:44 -04:00 committed by GitHub
parent b13feaeafd
commit eb9baa06a3
2 changed files with 5 additions and 3 deletions

View File

@ -97,6 +97,7 @@ Release and roadmap notes are available on the [WooCommerce Developers Blog](htt
- Fix: Set up shipping costs task, redirect to shipping settings after completion. #6791 - Fix: Set up shipping costs task, redirect to shipping settings after completion. #6791
- Add: Optional children prop to SummaryNumber component #6748 - Add: Optional children prop to SummaryNumber component #6748
- Fix: Onboarding logic on WooCommerce update to keep task list present. #6803 - Fix: Onboarding logic on WooCommerce update to keep task list present. #6803
- Fix: Load the page controller functions file first to prevent fatal errors when disabling WooCommerce Admin #6710
== 2.2.0 3/30/2021 == == 2.2.0 3/30/2021 ==

View File

@ -61,6 +61,10 @@ class FeaturePlugin {
* Init the feature plugin, only if we can detect both Gutenberg and WooCommerce. * Init the feature plugin, only if we can detect both Gutenberg and WooCommerce.
*/ */
public function init() { public function init() {
// Load the page controller functions file first to prevent fatal errors when disabling WooCommerce Admin.
$this->define_constants();
require_once WC_ADMIN_ABSPATH . '/includes/page-controller-functions.php';
/** /**
* Filter allowing WooCommerce Admin to be disabled. * Filter allowing WooCommerce Admin to be disabled.
* *
@ -70,12 +74,9 @@ class FeaturePlugin {
return; return;
} }
$this->define_constants();
require_once WC_ADMIN_ABSPATH . '/src/Notes/DeprecatedNotes.php'; require_once WC_ADMIN_ABSPATH . '/src/Notes/DeprecatedNotes.php';
require_once WC_ADMIN_ABSPATH . '/includes/core-functions.php'; require_once WC_ADMIN_ABSPATH . '/includes/core-functions.php';
require_once WC_ADMIN_ABSPATH . '/includes/feature-config.php'; require_once WC_ADMIN_ABSPATH . '/includes/feature-config.php';
require_once WC_ADMIN_ABSPATH . '/includes/page-controller-functions.php';
require_once WC_ADMIN_ABSPATH . '/includes/wc-admin-update-functions.php'; require_once WC_ADMIN_ABSPATH . '/includes/wc-admin-update-functions.php';
register_activation_hook( WC_ADMIN_PLUGIN_FILE, array( $this, 'on_activation' ) ); register_activation_hook( WC_ADMIN_PLUGIN_FILE, array( $this, 'on_activation' ) );