使用knp-paginator进行分页时,参数编号无效



我使用的是Symfony 2.3.20,带有knp分页器2.4.1、knp组件1.3.1和条令表单2.3.6一切都很好,直到我运行composer更新,从paginator调用下面的paginate返回一个无效的参数号异常(在composer升级之前一切都很正常)。。。请帮忙return $paginator->paginate($Query, $this->get('request')->query->get('page', 1), 10, array('pageParameterName' => 'page')); 堆栈跟踪

[1] DoctrineORMQueryQueryException: Invalid parameter number: number of bound variables does not match number of tokens
at n/a
    in C:xampphtdocswmn-restvendordoctrineormlibDoctrineORMQueryQueryException.php line 69
at DoctrineORMQueryQueryException::invalidParameterNumber()
    in C:xampphtdocswmn-restvendordoctrineormlibDoctrineORMQuery.php line 255
at DoctrineORMQuery->_doExecute()
    in C:xampphtdocswmn-restvendordoctrineormlibDoctrineORMAbstractQuery.php line 753
at DoctrineORMAbstractQuery->execute(null, '3')
    in C:xampphtdocswmn-restvendordoctrineormlibDoctrineORMAbstractQuery.php line 566
at DoctrineORMAbstractQuery->getScalarResult()
    in C:xampphtdocswmn-restvendordoctrineormlibDoctrineORMToolsPaginationPaginator.php line 144
at DoctrineORMToolsPaginationPaginator->count()
    in  line 
at count(object(Paginator))
    in C:xampphtdocswmn-restvendorknplabsknp-componentssrcKnpComponentPagerEventSubscriberPaginateDoctrineORMQuerySubscriberUsesPaginator.php line 43
at KnpComponentPagerEventSubscriberPaginateDoctrineORMQuerySubscriberUsesPaginator->items(object(ItemsEvent))
    in  line 
at call_user_func(array(object(UsesPaginator), 'items'), object(ItemsEvent))
    in C:xampphtdocswmn-restappcachedevclasses.php line 1665
at SymfonyComponentEventDispatcherEventDispatcher->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:xampphtdocswmn-restappcachedevclasses.php line 1598
at SymfonyComponentEventDispatcherEventDispatcher->dispatch('knp_pager.items', object(ItemsEvent))
    in C:xampphtdocswmn-restappcachedevclasses.php line 1762
at SymfonyComponentEventDispatcherContainerAwareEventDispatcher->dispatch('knp_pager.items', object(ItemsEvent))
    in C:xampphtdocswmn-restvendorknplabsknp-componentssrcKnpComponentPagerPaginator.php line 108
at KnpComponentPagerPaginator->paginate(object(Query), '1', '10', array('pageParameterName' => 'page'))
    in C:xampphtdocswmn-restsrcWmnMainBundleControllerMainController.php line 405
at WmnMainBundleControllerMainController->searchHotels('hilton', null, null, null, null)
    in C:xampphtdocswmn-restsrcWmnMainBundleControllerMainController.php line 182
at WmnMainBundleControllerMainController->searchResultsAction(null, null)
    in  line 
at call_user_func_array(array(object(MainController), 'searchResultsAction'), array(null, null))
    in C:xampphtdocswmn-restappbootstrap.php.cache line 2891
at SymfonyComponentHttpKernelHttpKernel->handleRaw(object(Request), '1')
    in C:xampphtdocswmn-restappbootstrap.php.cache line 2865
at SymfonyComponentHttpKernelHttpKernel->handle(object(Request), '1', true)
    in C:xampphtdocswmn-restappbootstrap.php.cache line 2994
at SymfonyComponentHttpKernelDependencyInjectionContainerAwareHttpKernel->handle(object(Request), '1', true)
    in C:xampphtdocswmn-restappbootstrap.php.cache line 2274
at SymfonyComponentHttpKernelKernel->handle(object(Request))
    in C:xampphtdocswmn-restwebapp_dev.php line 28

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

相关内容

  • 没有找到相关文章

最新更新