• I am getting the notice above quite frequently in my error log (it is not being displayed on the site). I can’t really replicate it as to understand what visitor behavior is triggering it, but looking at the code in that line as a beginner developer, I am not sure it is right:

    if ( $current_lang = $links->curlang->slug == $slug ) {

    I believe it is worth checking.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Chouby

    (@chouby)

    Hello,

    You should provide the complete error message and, better, a stack trace if you want us to check that.

    Thread Starter felipelungov

    (@felipelungov)

    Sorry, I just realized that the forum chopped the post title which contained the complete error message. Here it is:

    Notice: Trying to get property 'slug' of non-object in /home/user/public_html/wp-content/plugins/polylang/include/switcher.php on line 61

    I unfortunately don’t have the tools to provide you with a stack trace.

    Plugin Author Chouby

    (@chouby)

    Are you using a standard language switcher (menu or widget) or did you use the PHP function pll_the_languages()?

    Thread Starter felipelungov

    (@felipelungov)

    I’m using the standard switcher. Here is where it happens:

    https://darfyx.com

    I can pm you admin credentials if you think it might help.

    Plugin Author Chouby

    (@chouby)

    Hello,

    Are you sure that the issue is on https://darfyx.com ? This page is auto-redirected, so it never displays the language switcher.

    On this other hand, it looks like the error comes from a page where Polylang did not find any language. Which is rather strange as, in such case, Polylang should switch to the default language.

    To go further, it would be necessary that you are able to reproduce consistently the error (on a test site). Then we would probably know more about the source of the isuse.

    Thread Starter felipelungov

    (@felipelungov)

    Hi,

    Yes, I’m sure it was happening at darfyx. I was away on holidays, and now I am back and that message is no longer showing up. The last Polylang update I have recorded was on Jan 16th. Could it be that some other theme/plugin is/was using the same variable names such as $links, $slug or $lang?

    Anyhow, things look all right now. But I’m keeping an eye out. ; )

    Thanks for your support!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Notice: Trying to get property ‘slug’ of non-object in /public_html/wp’ is closed to new replies.