Closed pippinsplugins closed 4 years ago
In the get_results() method of the query class, the logic that validates the $where_cols is not working correctly. Currently it is:
get_results()
foreach ( $columns as $column ) { if ( ! array_key_exists( $column, $column_names ) ) { unset( $where_cols[ $column ] ); } }
This always results in the $where_cols getting set to an empty array.
To fix it, we need to unset using the column index, like so:
foreach ( $columns as $index => $column ) { if ( ! array_key_exists( $column, $column_names ) ) { unset( $where_cols[ $index ] ); } }
Discovered via Sugar Calendar https://github.com/sugarcalendar/standard/issues/352
In the
get_results()
method of the query class, the logic that validates the $where_cols is not working correctly. Currently it is:This always results in the $where_cols getting set to an empty array.
To fix it, we need to unset using the column index, like so:
Discovered via Sugar Calendar https://github.com/sugarcalendar/standard/issues/352