enqueue-dev icon indicating copy to clipboard operation
enqueue-dev copied to clipboard

Update uuid DbalProducer.php

Open KrisHarris opened this issue 1 year ago • 1 comments

From this thread https://github.com/ramsey/uuid/issues/327 ramsey/uuid 4.1 introduced Ramsey\Uuid\Lazy\LazyUuidFromString object which is used over the original Ramsey\Uuid\Uuid object when generating Uuids (I.E. when using Uuid::uuid4()).

This causes conversion issues when using the objects on inserting records. But can simply use toString() from UuidInterface to convert to actual guid (string) when calling DBAL insert.

The change means that 'id' => DbalType::GUID on parameter types array is correct, rather than throwing:

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing a query: SQLSTATE [IMSSP, -16]: An invalid PHP type for parameter 1 was specified.

This change is BC, tested with ramsey/uuid:3.9.7 and ramsey/uuid:4.7.5

KrisHarris avatar Apr 02 '24 16:04 KrisHarris

I have the same issue with the Uuid and can confirm that the change works. When can we expect that this will be merged into master branch?

svI24 avatar Oct 25 '24 13:10 svI24