DFZoneUSA / storefront

wcmp and storefront 2.4
0 stars 0 forks source link

storefront Version: 2.4.2 and WCMP #1

Open DFZoneUSA opened 5 years ago

DFZoneUSA commented 5 years ago

Hi,

we have a bug since the storefront update with the WCMP plugin error code dashboard vendor frontend storefront this is the message error : Notice: Trying to get property of non-object in /home/dutyfreezone/public_html/wp-content/themes/storefront/inc/woocommerce/class-storefront-woocommerce.php on line 405

Fatal error: Uncaught Error: Call to a member function get_storefront_theme_mods() on null in /home/dutyfreezone/public_html/wp-content/themes/storefront/inc/woocommerce/class-storefront-woocommerce.php:405 Stack trace: #0 /home/dutyfreezone/public_html/wp-content/themes/storefront/inc/woocommerce/class-storefront-woocommerce.php(95): Storefront_WooCommerce->get_woocommerce_extension_css() #1 /home/dutyfreezone/public_html/wp-includes/class-wp-hook.php(286): Storefront_WooCommerce->add_customizer_css('') #2 /home/dutyfreezone/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #3 /home/dutyfreezone/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #4 /home/dutyfreezone/public_html/wp-includes/script-loader.php(2231): do_action('wp_enqueue_scri...') #5 /home/dutyfreezone/public_html/wp-includes/class-wp-hook.php(286): wp_enqueue_scripts('') #6 /home/dutyfreezone/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #7 /home/dutyfreezone/public_h in /home/dutyfreezone/public_html/wp-content/themes/storefront/inc/woocommerce/class-storefront-woocommerce.php on line 405 our website is https://dutyfreezone.com we had to go back to the previous version so that our Vendor can access their dashboard correctly!!! can you help us ?

elendee commented 5 years ago

I found a one-line workaround to this issue (encountered exactly the same problem) the error is from the storefront function get_woocommerce_extension_css() So basically we skip that function, which means of course, that custom css from that func will be skipped. How to: Line 404 of storefront/inc/woocommerce/class-storefront-woocommerce.php add if(!$storefront){ return; } if you look in your error message you see that's the root of the problem - the null referred to is $storefront

PS ** I did this directly in storefront theme, which is horrible practice - as soon as Storefront updates I will have to do it again, but hopefully the next update will solve the problem.