Skip to content

Conversation

@skipperbent
Copy link

Fixed notices in QueryBuilderHandler class when $row[0] is not set.

@eL-Prova
Copy link

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.

@skipperbent
Copy link
Author

skipperbent commented May 21, 2016

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.

bookandbegin_dashboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants