projectnami
projectnami copied to clipboard
Undefined variable $groupby IN v3.0.1
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?
I think I see how that might be happening. Can add something to define it as empty when $distinct is not true.
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']} ";'
I placed a
$groupby = "";
at the beginning of the function get_terms()
, and that solved the problem.