• Resolved KissMyLegs

    (@kissmylegs)


    I recently began getting this error in my error log.
    Any assistance would be greatly appreciated.
    I am running Woocommerce Version:?8.6.1

    [05-Mar-2024 15:25:23 UTC] PHP Warning: Undefined array key “title” in /…/public_html/wp-content/plugins/woocommerce/templates/single-product/tabs/tabs.php on line 38

Viewing 3 replies - 16 through 18 (of 18 total)
  • Plugin Support Shameem R. a11n

    (@shameemreza)

    Hello @kissmylegs,

    It looks like you’ve done a great job troubleshooting the issue. Your observation about the PHP version potentially being a factor is a good one. With PHP 8.0 and later, more strict type checking and error handling have been introduced, and this could lead to warnings where none were seen before.

    The changes you’ve made to the wc-template-functions.php file should prevent the warnings from appearing, as you’re now checking if the array index exists before trying to access it. This is a good practice to follow in general to prevent potential issues. However, making these changes in the core file is not recommended.

    As for the cron job error, it’s hard to say what might be causing this without more information. It could be due to a server configuration issue, a conflict with another plugin, or many other factors.

    Rest assured, I couldn’t replicate the error on my testing site. I used various versions like 8.6.1, 8.5.2, 8.4, and 8.3.1.

    However, I suggest you continue to monitor your site and let us know if you see any further issues.

    Thanks for your patience and understanding.

    Thread Starter KissMyLegs

    (@kissmylegs)

    Hi. Yes, I do realize that making changes in the core WooCommerce files is not wise or smart and I know this change could get overwritten the next time WooCommerce is updated. I put it there in the meantime to see if the warning stops showing up in my error log, and it does.
    Are these warnings (tighter type checking, etc.) something the developers of WooCommerce will be fixing in a future WooCommerce release?

    Hello @kissmylegs,

    Yes, you’re correct, modifications to the core WooCommerce files can potentially be overwritten during updates.

    Our developers are constantly working on updates and improvements to make WooCommerce more efficient and user-friendly. Tighter type checking and similar warnings are part of these ongoing improvements.

    We recommend keeping your WooCommerce updated to the latest versions.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Undefined Array Key’ is closed to new replies.