Hi there @mcseem42 👋
PHP Fatal error
Thanks for reaching out, let’s figure out why things are not lining up!
A picture is worth a thousand words, as the saying goes, therefore, could you share a screenshot of the screen where the error appears, please? https://snipboard.io/ is a good (online) tool of choice for sharing it here.
In order to investigate things further, could you please share the site’s URL and a copy of its System Status? You can find it via WooCommerce > Status. Select Get system report and then click the Copy for support button. You can either paste it in your response here, or use https://pastebin.com/ for pasting it there and sharing it with us.
Also, could you please navigate to WooCommerce > Status > Logs and from the dropdown on the right side, please see if there are any logs starting with the words fatal-error.
If so, please select View and copy and paste them into your reply here.
Looking forward to hearing from you!
oh sure
screenshot: https://snipboard.io/C679md.jpg
system report: https://pastebin.com/pBCVfSxV
last log:
2022-12-01T15:24:31+00:00 CRITICAL Uncaught TypeError: Argument 1 passed to WooCommerce\Facebook\Admin\Products::render_google_product_category_fields_and_enhanced_attributes() must be an instance of WC_Product, bool given, called in /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin.php on line 1256 and defined in /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin/Products.php:44
Stack trace:
#0 /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin.php(1256): WooCommerce\Facebook\Admin\Products::render_google_product_category_fields_and_enhanced_attributes()
#1 /home/erd/web/lee/public_html/wp-includes/class-wp-hook.php(308): WooCommerce\Facebook\Admin->add_product_settings_tab_content()
#2 /home/erd/web/lee/public_html/wp-includes/class-wp-hook.php(33 in /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin/Products.php on line 44
2022-12-01T15:40:33+00:00 CRITICAL Uncaught TypeError: Argument 1 passed to WooCommerce\Facebook\Admin\Products::render_google_product_category_fields_and_enhanced_attributes() must be an instance of WC_Product, bool given, called in /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin.php on line 1256 and defined in /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin/Products.php:44
Stack trace:
#0 /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin.php(1256): WooCommerce\Facebook\Admin\Products::render_google_product_category_fields_and_enhanced_attributes()
#1 /home/erd/web/lee/public_html/wp-includes/class-wp-hook.php(308): WooCommerce\Facebook\Admin->add_product_settings_tab_content()
#2 /home/erd/web/lee/public_html/wp-includes/class-wp-hook.php(33 in /home/erd/web/lee/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Admin/Products.php on line 44
-
This reply was modified 3 years, 5 months ago by
mcseem42.
Hi!
I debugged this error and saw that the problem is in this
Admin.php:1143 global $post;
It doesn’t work, this $post returns my Size Chart for this product. I removed global $post and added instead
$post_id = $_REQUEST['post'];
$post = get_post( $post_id );
The error has been corrected.
Good luck!
Hello @mcseem42,
I debugged this error and saw that the problem is in this
Admin.php:1143 global $post;
It doesn’t work, this $post returns my Size Chart for this product. I removed global $post and added instead
$post_id = $_REQUEST[‘post’];
$post = get_post( $post_id );
Glad to hear you’ve figured it out! If you’re able to reproduce the problem consistently, I invite you to open a GitHub report about it here: https://github.com/woocommerce/facebook-for-woocommerce/issues
I will go ahead and mark the thread as solved, please feel free to open a new one if you have any other questions.
Cheers!