0

我正在使用 Symfony 2.3.20、knp-paginator 2.4.1、knp-components 1.3.1 和教义 orm 2.3.6 一切正常,直到我运行 composer update,从 paginator 调用以下分页返回一个无效参数数字异常(在作曲家更新之前一切都很好)......请帮助 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
4

1 回答 1

0

我从作曲家回滚到 knp 组件 1.2.5,一切都像一个魅力:-)

于 2014-10-23T21:02:15.790 回答