Home › Forums › WoodMart support forum › PHP warning in logs: Undefined array key “aria-describedby_text
PHP warning in logs: Undefined array key “aria-describedby_text
- This topic has 5 replies, 3 voices, and was last updated 1 month, 3 weeks ago by Aizaz Imtiaz Awan.
-
AuthorPosts
-
June 29, 2024 at 12:02 am #576334
ecb21ParticipantWe are seeing this PHP warning popping up every second or so in our logs. Can someone please take a look at it, thank you.
Got error 'PHP message: PHP Warning: Undefined array key "aria-describedby_text" in /home/*****/*****/public_html/wp-content/themes/woodmart/woocommerce/loop/add-to-cart.php on line 41'
June 29, 2024 at 3:53 pm #576444
Aizaz Imtiaz AwanKeymasterHello,
Please deactivate all the 3rd party plugins and activate only theme-required plugins on the site and then check the issue. I am sure your issue will be solved. Then Activate the 3rd party plugins one by one and check which plugin is creating the issue for you.
Otherwise, if the issue still exists then keep the 3rd party plugins deactivated and let me know I will check and give you a possible solution. Also switch the child to parent theme.
Best Regards.
July 22, 2024 at 6:39 pm #584916
BesirParticipantHello dears,
We are seeing the same warnings ,This is because of the updated code of add-to-cart.php ,
We disabled almost all plugins , kept only theme related and WPML plugins,I used the code below to print $args array content ,
<?php echo print_r( $args); ?>
there is no aria-describedby_text inside the array,
Array ( [quantity] => 1 [class] => button product_type_simple add_to_cart_button ajax_add_to_cart [attributes] => Array ( [data-product_id] => 17798 [data-product_sku] => Test-SKU [aria-label] => Add to cart: “Test Item” [aria-describedby] => [rel] => nofollow ) ) 1
I wonder what should be the content of “aria-describedby_text” ?
July 23, 2024 at 9:50 am #584994
Aizaz Imtiaz AwanKeymasterHello,
Maybe the problem is likely caused by custom code added to the child theme. Please review any custom code you have added to the child theme to identify and resolve the issue.
Best Regards.
July 23, 2024 at 10:30 am #585021
BesirParticipantHello Aizaz ,
Thank you for your reply,I downloaded Woodmart files and searched all php files fot “aria-describedby_text” ,
The only file containing this string is the “add-to-cart.php”,Then is searched PHP files for “aria-describedby” , and found it in “white-label.php” file
Looks like this is related to “White Label”!Since we are not using White Label then I fixed the issue by copying the “add-to-cart.php” to child theme and remove the
<?php echo esc_html( $args['aria-describedby_text'] ); ?>
as a workaround till we find a solution.
This might be useful for others who are facing same issue,Thanks and regards
July 23, 2024 at 1:15 pm #585074
Aizaz Imtiaz AwanKeymasterHello,
Glad to hear your issue has been resolved and thanks for sharing the solution. Keep us in mind for future questions and concerns, we’re always here to help!
Best Regards,
-
AuthorPosts
- You must be logged in to create new topics. Login / Register