projectnami icon indicating copy to clipboard operation
projectnami copied to clipboard

Undefined variable $groupby IN v3.0.1

Open lssyadmin opened this issue 2 years ago • 3 comments

Getting this error after upgrading to v3.0.1: line 754 Warning: Undefined variable $groupby in D:\IIS\csf\wp-includes\class-wp-term-query.php on line 754

Any thoughts?

lssyadmin avatar Oct 05 '22 00:10 lssyadmin

I think I see how that might be happening. Can add something to define it as empty when $distinct is not true.

patrickebates avatar Oct 05 '22 00:10 patrickebates

Hey, not sure if I broke other things but it seems that adding the definition to set it null fixed the issue on my side

`if ( $distinct ) { $groupby = "group by $fields $orderby_fields"; } else $groupby = null $this->request = " {$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$groupby} {$this->sql_clauses['orderby']} {$this->sql_clauses['limits']} ";'

nickLacatusu avatar Oct 05 '22 18:10 nickLacatusu

I placed a

        $groupby = "";

at the beginning of the function get_terms(), and that solved the problem.

PHuhn avatar Nov 02 '22 13:11 PHuhn