• maipiusenza

    (@maipiusenza)


    Hi, I get infinite PHP warnings on the file inc/walker/menu-walker.php

    Lines 98, 103, 211, 219 and 391



    the lines check for undefined properties, I fixed them this way, line 98:

    [27-Oct-2023 20:52:29 UTC] PHP Warning:  Undefined property: stdClass::$category_post in /home2/public_html/wp-content/themes/oceanwp/inc/walker/menu-walker.php on line 391
    [27-Oct-2023 20:52:29 UTC] PHP Warning:  Undefined property: stdClass::$category_post in /home2/public_html/wp-content/themes/oceanwp/inc/walker/menu-walker.php on line 98
    [27-Oct-2023 20:52:29 UTC] PHP Warning:  Undefined property: stdClass::$nolink in /home2/public_html/wp-content/themes/oceanwp/inc/walker/menu-walker.php on line 103
    [27-Oct-2023 20:52:29 UTC] PHP Warning:  Undefined property: stdClass::$template in /home2/public_html/wp-content/themes/oceanwp/inc/walker/menu-walker.php on line 211
    [27-Oct-2023 20:52:29 UTC] PHP Warning:  Undefined property: stdClass::$mega_template in /home2/public_html/wp-content/themes/oceanwp/inc/walker/menu-walker.php on line 211
    [27-Oct-2023 20:52:29 UTC] PHP Warning:  Undefined property: stdClass::$megamenu_widgetarea in /home2/public_html/wp-content/themes/oceanwp/inc/walker/menu-walker.php on line 219
    if ( $item->category_post != '' && $item->object == 'category' && 'vertical' != oceanwp_header_style() ) {

    changed into (first I check if it is a category, LATER if it is empty…

    if ( $item->object == 'category' && $item->category_post != '' && 'vertical' != oceanwp_header_style() ) {

    so on for the other lines, adding some isset() too, line 211, from:

    if ( ( $item->template || $item->mega_template ) && $this->megamenu != '' && 'vertical' != oceanwp_header_style() ) {

    to:

    if ( ( (isset($item->template) && $item->template) || (isset($item->mega_template) && $item->mega_template) ) && $this->megamenu != '' && 'vertical' != oceanwp_header_style() ) {

    and so on for the other lines…

    I tried to add the modified menu-walker.php fine in my child theme under inc/walker, but it seems that works only if I override it in the parent theme. So please fix it to avoid the problem on future updates.

    Thanks
    Nadia

Viewing 4 replies - 1 through 4 (of 4 total)
  • Shahin

    (@skalanter)

    Hello @maipiusenza,

    I fully examined the issue you have raised on this post and could not see it on my end(I’ve tested it with PHP 7.4, 8.0, and 8.2).

    Kindly provide us with your system environment information. Please navigate to WP Dashboard > OceanWP > OceanWP Panel > System Info: https://i.postimg.cc/0QZrGq46/system-info.png. You can send the information as code here or upload them to https://pastebin.com/ and get an exclusive link(without changing).

    Although it’s just a warning, we will forward it to the developer team for checking. If any issue is found, we will fix it in the next updates.

    Thank you for your report.
    Best Regards

    Thread Starter maipiusenza

    (@maipiusenza)

    Hi, here it is.
    I just obfuscated the site url

    https://pastebin.com/VLvc59yJ

    Shahin

    (@skalanter)

    Hello @maipiusenza,

    You removed the live site from it, and we don’t know how you created that menu. I could not see this problem on my end, and there are no other reports so far.

    We need to know the steps to reproduce.
    Explain to us step by step how we can reproduce the issue so we can recreate it somewhere other than your website.

    Meanwhile, this topic has been forwarded to the development team. We will check it, and if we find an issue, we’ll fix it in future updates.

    Also, I can see you are using the child theme. Since you have many customizations in the child theme on your website, please do the steps below and recheck your issue, and let us know the results.

    Troubleshooting child theme:
    1- Remove all customization on the child theme.
    2- add your customization one by one to the child theme.
    3- After adding each customization code, check your issue

    Note 1: in the staging website, if you have a cache plugin or server cache. You need to clear its cache contents or disable them.

    Note 2: Before it, please get a full backup from your website.

    I can see some plugins which can affect the menu. Please perform a basic troubleshooting checkup method and make sure the issue is related to our theme or plugin(s). To do this, deactivate all other plugins, then activate them one by one and check for this issue. Continue doing this until you find out what product is causing a conflict with our product. Then, provide the details as explained above.

    Thank you,
    Best Regards

    Thread Starter maipiusenza

    (@maipiusenza)

    Hi, I don’t want to share all the system info of a live site here.

    If you want me to copy/past part of the code here, just let me know what you need, maybe all the <header> section?

    On last theme update the problem is again active, I have a error_log_php of 600MB in one day

    • This reply was modified 12 months ago by maipiusenza.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Multiple PHP Warning: Undefined property on inc/walker/menu-walker.php’ is closed to new replies.