-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Check for _per_page existence #6702
Conversation
Why is it weird? Can you please add a test covering that case? |
Weird, become I never got it before and I didn't change something on my admin ^^'. I tried to look at how to add a test, it's easy in master (and the check is already added https://github.com/sonata-project/SonataAdminBundle/blob/master/src/Admin/AbstractAdmin.php#L726) but in 3.x there is theoricaly a default value https://github.com/sonata-project/SonataAdminBundle/blob/3.x/src/Admin/AbstractAdmin.php#L184 |
Have you debug where the problem come from? A way to test it is in an Admin class create a method that overrides |
After debugging, there was no This test https://github.com/sonata-project/SonataAdminBundle/blob/master/tests/Admin/AdminTest.php#L1484 will check for this bug in master. I'm not sure about writing a new test on 3.x with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test https://github.com/sonata-project/SonataAdminBundle/blob/master/tests/Admin/AdminTest.php#L1484 will check for this bug in master. I'm not sure about writing a new test on 3.x with a
NEXT_MAJOR: Remove this test
...
Hmm I think that test is testing it right now because this line:
SonataAdminBundle/src/Admin/AbstractAdmin.php
Line 2473 in 9eb2c5f
// $defaultSortValues = ['_page' => 1, '_per_page' => 25]; |
is not resolved yet, once there are default values, is the same situation than now and that test will not longer cover this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, we should add a test covering this case.
I looked again and the function
|
You can use |
I can override it, but it still will be set then. |
Subject
I got this weird error recently.
I am targeting this branch, because BC.
Changelog