• Resolved fkoomek

    (@fkoomek)


    Hello.
    I am getting this in my error log:
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 523
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘image_size’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 525
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘title_position’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 526
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 528
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_hover_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 530
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 543
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 523
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘image_size’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 525
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘title_position’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 526
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 528
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_hover_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 530
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 543
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 523
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘image_size’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 525
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘title_position’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 526
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 528
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_hover_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 530
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 543
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 523
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘image_size’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 525
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘title_position’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 526
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 528
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_hover_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 530
    [01-Apr-2020 23:39:42 UTC] PHP Notice: Trying to get property ‘thumbnail_id’ of non-object in /…/wp-content/plugins/menu-image/menu-image.php on line 543

    By debugging I found out that this notice starts to appear when I use Polylang language switcher as a menu item. When I remove it, it’s ok.
    Can you please check that? Thanks

    • This topic was modified 5 years, 12 months ago by fkoomek.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Rui Guerreiro

    (@takanakui)

    Hi @fkoomek,

    That is just a notice and not an error itself, you can disable the debug mode to avoid seeing those. Not sure what Polylang does in their menu items that cause this conflict.

    If you could modify menu-image.php#524 to
    if ( gettype( $item ) !== “string” && ” !== $item->thumbnail_id ) {

    this problem goes away.

    Plugin Author Rui Guerreiro

    (@takanakui)

    Hi @theking2,

    We released an update 2 days ago where we fixed that line due to some changes that happened in WordPress 5.4

    Can you try the latest version?

    Thread Starter fkoomek

    (@fkoomek)

    Hello.
    After update the notice still remains.

    • This reply was modified 5 years, 11 months ago by fkoomek.

    updated to version 2.9.6. has the same bug. corrected this in line 525
    if ( gettype( $item ) !== "string" && '' !== $item->thumbnail_id && $item->thumbnail_id > 0 ) {

    • This reply was modified 5 years, 11 months ago by theking2.
    Plugin Author Rui Guerreiro

    (@takanakui)

    Thanks @theking2 will include that change in the next update.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Polylang switcher compatibility’ is closed to new replies.