Woocommerce-admin: Fatal error when WooCommerce Admin and WooCommerce Measurement Price Calculator are active

Created on 9 Jun 2019  路  3Comments  路  Source: woocommerce/woocommerce-admin

Source: https://wordpress.org/support/topic/cant-upload-images-to-products-when-this-plugin-is-activated/

  1. Activate WooCommerce Admin and WooCommerce Measuerement Price Calculator.
  2. Go to _Products_ > _Add New_.
  3. Notice a fatal error occurs:
    > Fatal error: Cannot declare class WC_Settings_Products, because the name is already in use in /var/www/html/woocommerce/wp-content/plugins/woocommerce/includes/admin/settings/class-wc-settings-products.php on line 0

The error happens when we preload the data endpoints in WC_Admin_Loader:
https://github.com/woocommerce/woocommerce-admin/blob/master/includes/class-wc-admin-loader.php#L508-L514

bug

Most helpful comment

Looks like they have a fix coming in their next release - thanks @jeffstieler for opening the PR and helping with the fix!

All 3 comments

I think the fix for this will need to live in the WooCommerce Measuerement Price Calculator plugin - it's directly including the class-wc-settings-products.php file if it needs the WC_Settings_Products class rather than using core WC's loader method WC_Admin_Settings::get_settings_pages().

I'll open a PR on the plugin's repo.

Looks like they have a fix coming in their next release - thanks @jeffstieler for opening the PR and helping with the fix!

Thank you so much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

justinshreve picture justinshreve  路  3Comments

pmcpinto picture pmcpinto  路  3Comments

timmyc picture timmyc  路  4Comments

timmyc picture timmyc  路  3Comments

mujuonly picture mujuonly  路  3Comments