-
Notifications
You must be signed in to change notification settings - Fork 344
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
Paginator broke with latest version Doctrine? #123
Comments
I'm having the exact same issue. Something seems to have changed in doctrine, as there have been no real changes in this bundle since July 30. |
Having the same issue |
I can confirm, have the same error |
Yep, same here. |
Same here. Is there a workaround to get it working without editing the component itself? |
@raulfraile I'm still trying to figure that out. If I find a way, I'll post it in here as well! |
It is because of changes in the Doctrine pagination implementation So Pager pagination doesn't work correct using old method of setting parameters |
confirm |
composer.phar update with dev-master knp-paginator-bundle, querysubscriber still gives the same error. |
the fix has been merged into knp-components. @TheDevilOnLine actually @ChubV found the regression - i've just created the PR ;) |
Is this issue fixed? I have the latest knp-components commit ('Cleanup before tagging version 1.1.2') which includes the @pulse00 PR but I'm still getting the 'Invalid parameter number' error. Is anyone else still having this issue? |
I'm still having the same issue when the default_options 'distinct' is set to true. knp_paginator:
page_range: 5 # default page range used in pagination control
default_options:
page_name: page # page query parameter name
sort_field_name: sort # sort field query parameter name
sort_direction_name: direction # sort direction query parameter name
distinct: true # ensure distinct results, useful when ORM queries are using GROUP BY statements
template:
pagination: KnpPaginatorBundle:Pagination:sliding.html.twig # sliding pagination controls template
sortable: KnpPaginatorBundle:Pagination:sortable_link.html.twig # sort link template $em = $this->getDoctrine()->getEntityManager();
$dql = "SELECT a FROM ProjectxAccountBundle:Account a";
$query = $em->createQuery($dql);
$oPaginator = $this->get('knp_paginator');
$aAccounts = $oPaginator->paginate(
$query,
$this->get('request')->query->get('page', 1),
2
); |
+1 same issue is blocking me too Edit: Setting distinct to false as mentioned by @ThomasBerthe is working |
Setting distinct to false worked for us too. The issue is still there, but this seems like a valid workaround for now. |
Thanks for the tips |
+1 getting the parameter problem as well (including trying the fix) setting distinct to false has worked as a workaround |
any news about this issue ? |
+1 |
1 similar comment
+1 |
Did anyone tested latest changes? Many fixes were merged, so this should be fixed now. |
I just updated to the latest with doctrine 2.3.3 and this issue occurs. Geoffrey Tran On Feb 7, 2013, at 3:02 AM, Joseph Bielawski [email protected] wrote:
|
I just updated to the latest hash this version and after that I got this issue. |
+1 Setting distinct to false as mentioned by @ThomasBerthe is working |
+1 Edit @ThomasBerthe workaround works for me too. |
Confirming this issue as well with latest doctrine. |
+1 |
+1 |
+1 |
1 similar comment
👍 |
setting distinc to false works but now when i set some filters to the query the pagination count breaks |
i commented it out lines between 29 y 34 of /vendor/knplabs/knp-components/src/Knp/Component/Pager/Event/Subscriber/Paginate/Doctrine/ORM/QuerySubscriber.php and now works fine /*if (version_compare(\Doctrine\ORM\Version::VERSION, '2.3.0', '>=')) { $useDoctrineWalkers = true; $useDoctrineOutputWalker = true; } else if (version_compare(\Doctrine\ORM\Version::VERSION, '2.2.0', '>=')) { $useDoctrineWalkers = true; }*/ |
Switching back to any doctrine version before 2.3 fixes this for me. |
+1 |
Same issue. Doing what @metalvarez proposes also works for me. |
I had the same problem and resolved this like @metalvarez. It works. |
+1 same problem |
+1 |
@metalvarez Using distrinct=false, my pagination count is broken, too - but only when the list contains a single item |
@bicpi try this PR, please KnpLabs/knp-components#48 |
Fix was merged, new version tagged, in next few mins should be available at packagist. |
I just updated my symfony using Composer (which also updated my Doctrine etc). All of a sudden I now get the error 'Invalid parameter number: number of bound variables does not match number of tokens'.
I was able to fix this by making a change to /vendor/knplabs/knp-components/src/Knp/Component/Pager/Event/Subscriber/Paginate/Doctrine/ORM/QuerySubscriber.php
I changed line 27 from
to
My doctrine uses version 2.3.x-dev
The text was updated successfully, but these errors were encountered: