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

[5.2] Fix pagination issue in the latest release #14389

Merged
merged 1 commit into from
Jul 20, 2016
Merged

[5.2] Fix pagination issue in the latest release #14389

merged 1 commit into from
Jul 20, 2016

Conversation

themsaid
Copy link
Member

Addressed in #14387

The issue was caused by this change: https://github.com/laravel/framework/pull/14188/files

if $total is evaluated as false, $perPage = $perPage ?: $this->model->getPerPage() will never be executed leaving $perPage equal to null if it wasn't provided in the method call.

So calling ->paginate() without any arguments, if no results found $perPage will be equal to null causing a Division By Zero error in LengthAwarePaginator

@themsaid themsaid changed the title [5.2] Fix pagination issue in teh latest release [5.2] Fix pagination issue in the latest release Jul 20, 2016
@taylorotwell taylorotwell merged commit 4835c0a into laravel:5.2 Jul 20, 2016
@mnabialek
Copy link
Contributor

mnabialek commented Jul 22, 2016

@themsaid Thank you for quick fix to my PR :)

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.

3 participants