Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed notices in QueryBuilderHandler #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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