WPSOLR: error on term
- ovaislak@hotmail.comParticipant5 years, 5 months ago #11937
Error on line 313 of file /public_html/wp-content/plugins/wpsolr-pro/wpsolr/core/classes/models/post/class-wpsolr-model-post.php: Trying to get property ‘name’ of non-object
getting this error
ovaislak@hotmail.comParticipant5 years, 5 months ago #11944The indexing was running smoothly and indexed 54000 products and then suddenly stopped with the aforementioned error. I tried running the index again with Display debug infos during indexing and found the product id using the following SQL syntax
SELECT ID, post_modified, post_parent, post_type FROM wp_posts AS posts WHERE ((post_modified = ‘2019-02-11 14:18:01’ AND ID > 91146) OR (post_modified > ‘2019-02-11 14:18:01’)) AND ( post_status IN (‘publish’) AND ( post_type = ‘product’ ) ) AND ID NOT IN (124038) ORDER BY post_modified ASC, ID ASC LIMIT 1
the product id was 1224
I edited the the product by clicking the update button and then rerun the index but it isn’t running now givving the following error
Error on line 313 of file /public_html/wp-content/plugins/wpsolr-pro/wpsolr/core/classes/models/post/class-wpsolr-model-post.php: Trying to get property ‘name’ of non-object
ovaislak@hotmail.comParticipant5 years, 5 months ago #11949I used that feature even trashed the product but nothing seems to work.
ovaislak@hotmail.comParticipant5 years, 5 months ago #11951After trashing the product I deleted the index started it all over again again got this error
ovaislak@hotmail.comParticipant5 years, 5 months ago #11953I am not certain since it does not output the error even after checking “Display debug infos during indexing”. Should I share the credentials with you to identify the exact problem ?
ovaislak@hotmail.comParticipant5 years, 5 months ago #11956Error on line 313 of file /public_html/wp-content/plugins/wpsolr-pro/wpsolr/core/classes/models/post/class-wpsolr-model-post.php: Trying to get property ‘name’ of non-object
ovaislak@hotmail.comParticipant5 years, 5 months ago #11959This time there is a new product
ID 73010Why WPsolr is unable to index these products ? and do i need to re-run the index everytime this error pop ups ?
It will then take forever to generate the index 🙁
ovaislak@hotmail.comParticipant5 years, 5 months ago #1196155000 products are indexed with same taxonomies.
wpsolrKeymaster5 years, 5 months ago #11962A small workaround to detect the problem origin:
Line 313 of /public_html/wp-content/plugins/wpsolr-pro/wpsolr/core/classes/models/post/class-wpsolr-model-post.php
Replace
array_push( $term_parents_names, $term_parent->name ); // Add the term to the non-flat hierarchy (for filter queries on all the hierarchy levels) array_push( $taxonomy_non_flat_hierarchies, $term_parent->name );
with
if ( method_exists( $term_parent, 'name' ) ) { array_push( $term_parents_names, $term_parent->name ); // Add the term to the non-flat hierarchy (for filter queries on all the hierarchy levels) array_push( $taxonomy_non_flat_hierarchies, $term_parent->name ); } else { throw new \Exception( sprintf( "WPSOLR: term %s for taxonomy %s has no name", $term_parent_id, $parent ) ); }
You must be logged in to reply to this topic.