There is something weird going on. As I said in my first post I deactivated all plugins except Filter everything and it had this issue.
I tested in 4 sites, all of them have php 7.4.
They worked well before but crashed overnight…
After my last answer I<u> did not change anything.</u> BUT somehow over the other night 2 of the sites came back alive and started to work but 2 of the sites is still having this issue.
Someone reported today tha he is having the same issue but as I see this post is deleted by the moderator.
he wrote:
Notice: Undefined offset: 888 in /wp-content/plugins/filter-everything/src/Entities/TaxonomyEntity.php on line 98
Warning: array_merge(): Expected parameter 2 to be an array, null given in /wp-content/plugins/filter-everything/src/Entities/TaxonomyEntity.php on line 98
Warning: array_unique() expects parameter 1 to be array, null given in /wp-content/plugins/filter-everything/src/Entities/TaxonomyEntity.php on line 98
I think 888 is a product category ID.
I resolved editing your plugin, file src/Entities/TaxonomyEntity.php, lines 89~102:
// Fix for counts for parent, when 'include_children=true'
// Add posts from children terms to their parents
// To make correct counts for their parents
if( ! empty( $this->descendants ) ){
$parents = array_keys( $this->descendants );
foreach ( $ids as $term_id => $post_ids_array ){
if( in_array( $term_id, $parents ) ){
foreach ( $this->descendants[$term_id] as $child_term_id ){
$ids[$term_id] = array_unique( array_merge( $ids[$term_id], $ids[$child_term_id] ) );
}
}
}
}
With this:
// Fix for counts for parent, when 'include_children=true'
// Add posts from children terms to their parents
// To make correct counts for their parents
if( ! empty( $this->descendants ) ){
$parents = array_keys( $this->descendants );
foreach ( $ids as $term_id => $post_ids_array ){
if( in_array( $term_id, $parents ) ){
foreach ( $this->descendants[$term_id] as $child_term_id ){
if (empty($ids[$child_term_id])) {
continue;
}
$ids[$term_id] = array_unique( array_merge( $ids[$term_id], $ids[$child_term_id] ) );
}
}
}
}
But I don’t know if it can be a correct solution.
-
This reply was modified 3 years, 3 months ago by Janke.