我使用Symfony 2.3.20,使用knp-paginator 2.4.1,knp-components 1.3.1和doctrine orm 2.3.6
一切都运行正常,直到我运行作曲家更新,从paginator调用以下paginate返回一个无效的参数号异常(在作曲家更新之前一切都很好)...一些帮助请
return $paginator->paginate($Query, $this->get('request')->query->get('page', 1), 10, array('pageParameterName' => 'page'));
堆栈跟踪
[1] Doctrine\ORM\Query\QueryException: Invalid parameter number: number of bound variables does not match number of tokens
at n/a
in C:\xampp\htdocs\wmn-rest\vendor\doctrine\orm\lib\Doctrine\ORM\Query\QueryException.php line 69
at Doctrine\ORM\Query\QueryException::invalidParameterNumber()
in C:\xampp\htdocs\wmn-rest\vendor\doctrine\orm\lib\Doctrine\ORM\Query.php line 255
at Doctrine\ORM\Query->_doExecute()
in C:\xampp\htdocs\wmn-rest\vendor\doctrine\orm\lib\Doctrine\ORM\AbstractQuery.php line 753
at Doctrine\ORM\AbstractQuery->execute(null, '3')
in C:\xampp\htdocs\wmn-rest\vendor\doctrine\orm\lib\Doctrine\ORM\AbstractQuery.php line 566
at Doctrine\ORM\AbstractQuery->getScalarResult()
in C:\xampp\htdocs\wmn-rest\vendor\doctrine\orm\lib\Doctrine\ORM\Tools\Pagination\Paginator.php line 144
at Doctrine\ORM\Tools\Pagination\Paginator->count()
in line
at count(object(Paginator))
in C:\xampp\htdocs\wmn-rest\vendor\knplabs\knp-components\src\Knp\Component\Pager\Event\Subscriber\Paginate\Doctrine\ORM\QuerySubscriber\UsesPaginator.php line 43
at Knp\Component\Pager\Event\Subscriber\Paginate\Doctrine\ORM\QuerySubscriber\UsesPaginator->items(object(ItemsEvent))
in line
at call_user_func(array(object(UsesPaginator), 'items'), object(ItemsEvent))
in C:\xampp\htdocs\wmn-rest\app\cache\dev\classes.php line 1665
at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(array(array(object(QueryBuilderSubscriber), 'items'), array(object(QueryBuilderSubscriber), 'items'), array(object(DBALQueryBuilderSubscriber), 'items'), array(object(QuerySubscriber), 'items'), array(object(QuerySubscriber), 'items'), array(object(ElasticaQuerySubscriber), 'items'), array(object(PropelQuerySubscriber), 'items'), array(object(SolariumQuerySubscriber), 'items'), array(object(PropelQuerySubscriber), 'items'), array(object(UsesPaginator), 'items'), array(object(QuerySubscriber), 'items'), array(object(QuerySubscriber), 'items'), array(object(CollectionSubscriber), 'items'), array(object(PropelQuerySubscriber), 'items'), array(object(SolariumQuerySubscriber), 'items'), array(object(ElasticaQuerySubscriber), 'items'), array(object(ArraySubscriber), 'items')), 'knp_pager.items', object(ItemsEvent))
in C:\xampp\htdocs\wmn-rest\app\cache\dev\classes.php line 1598
at Symfony\Component\EventDispatcher\EventDispatcher->dispatch('knp_pager.items', object(ItemsEvent))
in C:\xampp\htdocs\wmn-rest\app\cache\dev\classes.php line 1762
at Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('knp_pager.items', object(ItemsEvent))
in C:\xampp\htdocs\wmn-rest\vendor\knplabs\knp-components\src\Knp\Component\Pager\Paginator.php line 108
at Knp\Component\Pager\Paginator->paginate(object(Query), '1', '10', array('pageParameterName' => 'page'))
in C:\xampp\htdocs\wmn-rest\src\Wmn\MainBundle\Controller\MainController.php line 405
at Wmn\MainBundle\Controller\MainController->searchHotels('hilton', null, null, null, null)
in C:\xampp\htdocs\wmn-rest\src\Wmn\MainBundle\Controller\MainController.php line 182
at Wmn\MainBundle\Controller\MainController->searchResultsAction(null, null)
in line
at call_user_func_array(array(object(MainController), 'searchResultsAction'), array(null, null))
in C:\xampp\htdocs\wmn-rest\app\bootstrap.php.cache line 2891
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
in C:\xampp\htdocs\wmn-rest\app\bootstrap.php.cache line 2865
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
in C:\xampp\htdocs\wmn-rest\app\bootstrap.php.cache line 2994
at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
in C:\xampp\htdocs\wmn-rest\app\bootstrap.php.cache line 2274
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
in C:\xampp\htdocs\wmn-rest\web\app_dev.php line 28
答案 0 :(得分:0)
我从作曲家回滚到组件1.2.5,一切都像魅力: - )