Home › Forums › WooCommerce Personalized Product Options Manager (PPOM) › Weird critical error from add new page when ppom products in cart.
- This topic has 2 replies, 2 voices, and was last updated 2 years, 6 months ago by jason jiang.
-
AuthorPosts
-
June 7, 2022 at 1:14 pm #139791jason jiangParticipant
I found a very weird error that confused me a lot of days. I descrbed it as follows:
1. In front login in as admin and add a product with ppom fields to cart.(I am testing the shopping flow)
2. In backend login in as admin of course, and go to Pages>Add New, then error occurred.
3. I checked the error log, show as follow:
**********************error message begin****************************
2022-06-07 13:03:30.564505 [NOTICE] [864] [216.250.96.181:54168-3#wordpress] [STDERR] PHP Fatal error: Uncaught TypeError: strip_tags(): Argument #1 ($string) must be of type string, array given in /var/www/html/wp-includes/formatting.php:5386
Stack trace:
#0 /var/www/html/wp-includes/formatting.php(5386): strip_tags()
#1 [internal function]: wp_strip_all_tags()
#2 /var/www/html/wp-content/plugins/woo-gutenberg-products-block/src/StoreApi/Schemas/V1/CartItemSchema.php(475): array_map()
#3 [internal function]: Automattic\WooCommerce\StoreApi\Schemas\V1\CartItemSchema->format_item_data_element()
#4 /var/www/html/wp-content/plugins/woo-gutenberg-products-block/src/StoreApi/Schemas/V1/CartItemSchema.php(462): array_map()
#5 /var/www/html/wp-content/plugins/woo-gutenberg-products-block/src/StoreApi/Schemas/V1/CartItemSchema.php(354): Automattic\WooCommerce\StoreApi\Schemas\V1\CartItemSchema->get_item_data()
#6 [internal function]: Automattic\WooCommerce\StoreApi\Schemas\V1\CartItemSchema->get_item_response()
#7 /var/www/html/wp-content/plugins/woo-gutenberg-products-block/src/StoreApi/Schemas/V1/AbstractSchema.php(261): array_map()
#8 /var/www/html/wp-content/plugins/woo-gutenberg-products-block/src/StoreApi/Schemas/V1/CartSchema.php(331): Automattic\WooCommerce\StoreApi\Schemas\V1\AbstractSchema->get_item_responses_from_schema()
#9 /var/www/html/wp-content/plugins/woo-gutenberg-products-block/src/StoreApi/Routes/V1/Cart.php(50): Automattic\WooCommerce\StoreApi\Schemas\V1\CartSchema->get_item_response()
#10 /var/www/html/wp-content/plugins/woo-gutenberg-products-block/src/StoreApi/Routes/V1/AbstractRoute.php(109): Automattic\WooCommerce\StoreApi\Routes\V1\Cart->get_route_response()
#11 /var/www/html/wp-content/plugins/woo-gutenberg-products-block/src/StoreApi/Routes/V1/AbstractCartRoute.php(80): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response()
#12 /var/www/html/wp-includes/rest-api/class-wp-rest-server.php(1143): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractCartRoute->get_response()
#13 /var/www/html/wp-includes/rest-api/class-wp-rest-server.php(990): WP_REST_Server->respond
2022-06-07 13:03:30.564557 [NOTICE] [864] [216.250.96.181:54168-3#wordpress] [STDERR] _to_request()
#14 /var/www/html/wp-includes/rest-api.php(519): WP_REST_Server->dispatch()
#15 /var/www/html/wp-includes/rest-api.php(2868): rest_do_request()
#16 /var/www/html/wp-content/plugins/woo-gutenberg-products-block/src/Assets/AssetDataRegistry.php(317): rest_preload_api_request()
#17 /var/www/html/wp-content/plugins/woo-gutenberg-products-block/src/BlockTypes/AllProducts.php(40): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->hydrate_api_request()
#18 /var/www/html/wp-content/plugins/woo-gutenberg-products-block/src/BlockTypes/AllProducts.php(33): Automattic\WooCommerce\Blocks\BlockTypes\AllProducts->hydrate_from_api()
#19 /var/www/html/wp-content/plugins/woo-gutenberg-products-block/src/BlockTypes/AbstractBlock.php(98): Automattic\WooCommerce\Blocks\BlockTypes\AllProducts->enqueue_data()
#20 /var/www/html/wp-includes/class-wp-hook.php(307): Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock->enqueue_editor_assets()
#21 /var/www/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
#22 /var/www/html/wp-includes/plugin.php(476): WP_Hook->do_action()
#23 /var/www/html/wp-admin/edit-form-blocks.php(270): do_action()
#24 /var/www/html/wp-admin/post-new.php(72): require(‘…’)
#25 {main}
thrown in /var/www/html/wp-includes/formatting.php on line 5386
******************error message end*************************As above I guess the error logic is that Add New Page will call gutenberg block, block will call cart logic although I don’t know why, cart will call ppom data although I don’t know why backend call front data.
I have tested the logic with product without ppom fields, that’s OK, so I said the error is related with ppom.
Can you fix it? I am confused by this.June 11, 2022 at 1:06 pm #140140nmediaKeymasterHi,
Sorry for the late reply. But I don’t see a refeencre in the above error related to PPOM.
June 12, 2022 at 1:26 pm #140180jason jiangParticipantThe error occured when the product with ppom fields was in cart, when I removed the product with ppom fields then the error was gone.
-
AuthorPosts
- You must be logged in to reply to this topic.