lonnieezell / Bonfire2

CodeIgniter 4-based application skeleton
MIT License
127 stars 49 forks source link

User Role filters cause error if no user in that role #446

Closed daracorcoran closed 4 months ago

daracorcoran commented 4 months ago

Selecting a User Role filter for a group which contains no users causes a MySQL syntax error and 500 ajax response. The list does not update.

It seems to be caused by the if($secondQuery) block in UserFilter.php.

Instead of the $secondQuery stuff maybe a Distinct clause (or Group By) will suffice to remove duplicates?

Changing

$secondQuery = true;
$this->select('users.id');

To

$this->distinct();
$this->select('users.*');

But perhaps there's a good reason this wasn't considered as a solution?

daracorcoran commented 4 months ago

Resolved by #456