• Hi !

    I’m here because since this morning, my client site got an error which say :

    : preg_match() expects parameter 2 to be string, object given in on line : strip_tags() expects parameter 1 to be string, object given in on line : Trying to get property of non-object in on line
    26/homepages/22/d475349327/htdocs/wordpress/wp-content/themes/twentysixteen/archive.phpNotice1571/homepages/22/d475349327/htdocs/wordpress/wp-includes/formatting.phpWarning1133/homepages/22/d475349327/htdocs/wordpress/wp-includes/formatting.phpWarning4/homepages/22/d475349327/htdocs/wordpress/wp-content/themes/twentysixteen/functions.phpNotice

    So i set the DEBUG on true and there is an other error :

    : Undefined index: sense in on line

    No line, no folder. I’m searching on the web and there is no reference, All I know it’s that this line cause this error :

    $slider_et_descr = category_description( get_category_by_slug($yourcat)->term_id );

    But it was working perfeclty since 2 months…

    Nicolas.

Viewing 4 replies - 1 through 4 (of 4 total)
  • GREP!

    https://www.cyberciti.biz/faq/howto-use-grep-command-in-linux-unix/

    Use the linux grep command to hunt down that undefined index “sense” – that will give you a list of files which contain the word ‘sense’.

    From webroot/wp-content:

    grep -rni sense *

    Of course this will only give you a few clues as to where the error might be, but its a start ?? Good luck – let us know if we can help you any further – or, of course, if this solution isn’t viable.

    Also, possibly a silly question..

    Have you confirmed that the $yourcat variable is a string, as opposed to an object?

    Thread Starter nicow65

    (@nicow65)

    Hmmm I do not hav an access to linux command, it’s on a mutual server.

    How can I confirm that my $yourcat var is a string ? is there any function ?

    Try
    echo '<pre>' . var_dump( $yourcat ) . </pre>;
    to output the variable to the page.

    Use
    is_string( $var )
    to get a TRUE or FALSE value back as well

    https://php.net also has some other great search tools which will help you fish out various random helpful functions ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unknow error’ is closed to new replies.