Error in Log
-
Hello, I have an error in the log which occurs when someone does a search. The criteria it happens under is multiple post types need to be ticked in the Edit Widget area > Items to Search Through (either Products and Posts, or Products and pages). Issue doesn’t happen if posts and pages only are ticked.
When a search is done the URL is e.g. ?s=roses&search_id=1&post_type=product
Then I get this error in the log:
Got error ‘PHP message: PHP Warning:? Attempt to read property “labels” on null in /var/www/vhosts/******/httpdocs/wp-includes/general-template.php on line 3232PHP message: PHP Warning:? Attempt to read property “name” on null in /var/www/vhosts/****/httpdocs/wp-includes/general-template.php on line 3232PHP message: PHP Warning:? Attempt to read property “name” on null in /var/www/vhosts/****/httpdocs/wp-includes/general-template.php on line 3235’, referer: https://***/?s=climbing&search_id=1&post_type=product
Diving into /wp-includes/general-template.php line 3232 and var_dumping $post_type returns a string of “post,product”, then var_dumping $post_type_obj returns null.
If I only tick product, $post_type returns “product” and $post_type_obj does not return null, it returns the product CPT.
Please could you take a look at this?
- The topic ‘Error in Log’ is closed to new replies.