pixie
pixie copied to clipboard
Fixed notices in QueryBuilderHandler
Fixed notices in QueryBuilderHandler class when $row[0] is not set.
May it be possible for you to add a unit-test to show the bug / fix? This will make the source of Pixie more secure.
I think the fix is a bit small to create unit-testing for.
If you want to reproduce the error yourself, it seems like there's it occurs when calling count() after having used groupBy.
This is my query if you want to investigate any further yourself.
$messages->whereNotNull('customer_id')->orderBy('created_date', 'DESC');
$updateQuery = $messages;
$messages = Message::table($messages->subQuery($messages, 'messages'));
$messages->orderBy('read');
$messages->orderBy('created_date', 'DESC');
$messages->groupBy('event_id');
$this->maxPages = ceil($messages->count() / $this->limit);
$this->page = input()->get('page', 0);
$messages->offset($this->page * $this->limit);
$messages->limit($this->limit);
$this->messages = $messages->all();
// Set messages as read
$updateQuery->update(['read' => 1]);
Removing groupBy removes the notice - which is triggered by calling the count() method.
