Skip to content
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

Using primary key with data converter fails since doctrine/orm 2.6.4 #578

Open
ofriedrich opened this issue Oct 2, 2019 · 4 comments

Comments

@ofriedrich
Copy link

commented Oct 2, 2019

In doctrine/orm 2.6.4 https://github.com/doctrine/orm/releases/tag/v2.6.4 a bug in paginator has been fixed: doctrine/orm#7821

This causes an error using the KnpPaginatorBundle:

Could not convert database value ".�,�@y���2�9~E" to Doctrine Type uuid_binary

How to test:

  • create an entity with uuid_binary as primary key
  • add at least one entry to the database
  • create a page using the KnpPaginator
  • open the page
@garak

This comment has been minimized.

Copy link
Collaborator

commented Oct 2, 2019

Could you provide a stack trace of error?

@ofriedrich

This comment has been minimized.

Copy link
Author

commented Oct 2, 2019

stack trace:

Could not convert database value ".�,�@y���2�9~E" to Doctrine Type uuid_binary

  at vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php:33
  at Doctrine\DBAL\Types\ConversionException::conversionFailed('.�,�@y���2�9~E', 'uuid_binary')
     (vendor/ramsey/uuid-doctrine/src/UuidBinaryType.php:101)
  at Ramsey\Uuid\Doctrine\UuidBinaryType->convertToDatabaseValue('.�,�@y���2�9~E', object(MySQL57Platform))
     (vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1499)
  at Doctrine\DBAL\Connection->convertToDatabaseValue('.�,�@y���2�9~E', 'uuid_binary')
     (vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php:181)
  at Doctrine\ORM\Tools\Pagination\WhereInWalker::Doctrine\ORM\Tools\Pagination\{closure}('.�,�@y���2�9~E')
  at array_map(object(Closure), array('.�,�@y���2�9~E', '' . "\0" . '�����LI�T�=�저', ',U�� 	@�h�����', '�1����@Q�p��f��', '�O�0@�Gu�}>���C.', 'y
��)D弞�3^��9', '���]��G灨�u�*��', 'Zh��~�C�2���
��', '�t�{)�N����8è��', '��t�t�M]�2��,��<', 'Ѕ_(��A���,���
5', '�\\��*�N����a�k��', '�
�";RG����k
O��', '�����<Hf����|>��', '<�Cp��N���ޔA"' . "\0" . '�', '�}�~��Oo�����S
�', 'A�|�mA�����', '��8=,L����2���y', '��yS`8M�}�q�J)�', '����~\'N��R��1�e�', '����*�I��B�1٨�', 'Il��$ED��������D', '����7J���J��z��', '8�
�uZKǕm%岟�', 'u���AT@��$�8���'))
     (vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php:182)
  at Doctrine\ORM\Tools\Pagination\WhereInWalker->convertWhereInIdentifiersToDatabaseValue('uuid_binary')
     (vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php:119)
  at Doctrine\ORM\Tools\Pagination\WhereInWalker->walkSelectStatement(object(SelectStatement))
     (vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalkerChain.php:113)
  at Doctrine\ORM\Query\TreeWalkerChain->walkSelectStatement(object(SelectStatement))
     (vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:389)
  at Doctrine\ORM\Query\Parser->parse()
     (vendor/doctrine/orm/lib/Doctrine/ORM/Query.php:286)
  at Doctrine\ORM\Query->_parse()
     (vendor/doctrine/orm/lib/Doctrine/ORM/Query.php:298)
  at Doctrine\ORM\Query->_doExecute()
     (vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:967)
  at Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache(null, 1)
     (vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:922)
  at Doctrine\ORM\AbstractQuery->execute(null, 1)
     (vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:726)
  at Doctrine\ORM\AbstractQuery->getResult(1)
     (vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php:170)
  at Doctrine\ORM\Tools\Pagination\Paginator->getIterator()
  at iterator_to_array(object(Paginator))
     (vendor/knplabs/knp-components/src/Knp/Component/Pager/Event/Subscriber/Paginate/Doctrine/ORM/QuerySubscriber.php:48)
  at Knp\Component\Pager\Event\Subscriber\Paginate\Doctrine\ORM\QuerySubscriber->items(object(ItemsEvent), 'knp_pager.items', object(TraceableEventDispatcher))
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:126)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(ItemsEvent), 'knp_pager.items', object(TraceableEventDispatcher))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:247)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'knp_pager.items', object(ItemsEvent))
     (vendor/symfony/event-dispatcher/EventDispatcher.php:73)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(ItemsEvent), 'knp_pager.items')
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:168)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(ItemsEvent), 'knp_pager.items')
     (vendor/knplabs/knp-components/src/Knp/Component/Pager/Paginator.php:181)
  at Knp\Component\Pager\Paginator->dispatch('knp_pager.items', object(ItemsEvent))
     (vendor/knplabs/knp-components/src/Knp/Component/Pager/Paginator.php:123)
  at Knp\Component\Pager\Paginator->paginate(object(Query), 1, 25)
     (src/Shop/Backend/Controller/ProductsController.php:79)
  at App\Shop\Backend\Controller\ProductsController->listAction(object(Request), object(Paginator))
     (vendor/symfony/http-kernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:68)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:198)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (web/index.php:25)
@Minduser76

This comment has been minimized.

Copy link

commented Oct 2, 2019

I can confirm this issue.
Since the minor update from doctrine/orm from version 2.6.3 to 2.6.4, KnpPaginatorBundle is not working with uuids anymore.
This only happens with binary uuids.

@garak

This comment has been minimized.

Copy link
Collaborator

commented Oct 2, 2019

It looks like problem is outside this bundle (and outside Pager library, too).
Let's see how linked Doctrine issue evolves

@garak garak added the in progress label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.