PHP Fatal Error after last update
-
Hi!
After last update of your theme (ver. 1.2.7) in my site I have this error:
PHP Fatal error: Uncaught Error: Call to a member function get_gallery_image_ids() on null in ......./public_html/wp-content/themes/ascend/lib/woocommerce/woo-single-product-hooks.php:25 Stack trace: #0 ......./public_html/wp-includes/class-wp-hook.php(288): single_product_post_class(Array) #1 ......./public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(Array, Array) #2 ......./public_html/wp-includes/post-template.php(543): apply_filters('post_class', Array, Array, -1) #3 ......./public_html/wp-includes/post-template.php(423): get_post_class(Array, NULL) #4 ......./public_html/wp-content/themes/me-pro/templates/content-product.php(203): post_class() #5 ......./public_html/wp-content/themes/ascend/lib/woocommerce/woo-single-product-hooks.php on line 25
The problem is born because in file functions.php it’s not verified that Woocommerce is active before the request of Woocommerce libraries for theme support.
I have fixed problem with:
if ( class_exists( 'WooCommerce' ) ) { require_once( trailingslashit( get_template_directory() ) . 'lib/woocommerce/woo-support.php'); // Woocommerce functions require_once( trailingslashit( get_template_directory() ) . 'lib/woocommerce/woo-archive-hooks.php'); // Woocommerce archive functions require_once( trailingslashit( get_template_directory() ) . 'lib/woocommerce/woo-single-product-hooks.php'); // Woocommerce Single Product require_once( trailingslashit( get_template_directory() ) . 'lib/woocommerce/woo-account.php'); // Woocommerce My Account require_once( trailingslashit( get_template_directory() ) . 'lib/woocommerce/woo-cart.php'); // Woocommerce Cart }
Please fix it in next release.
Regards.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘PHP Fatal Error after last update’ is closed to new replies.