api icon indicating copy to clipboard operation
api copied to clipboard

Application exception on latest version

Open tasselchof opened this issue 1 year ago • 6 comments

Hi,

I encountered this exception while attempting to retrieve users from the database:

TypeError raised in file /home/dev/domains/api-dev.app/vendor/doctrine/persistence/src/Persistence/Reflection/RuntimeReflectionProperty.php line 61:
Message: Cannot assign resource to property Api\App\Entity\AbstractEntity::$uuid of type ?Ramsey\Uuid\UuidInterface

It's standard application, except I removed link to the roles (trying to build basic graphql api - to get users together with table properties for my frontend).

I am using ramsey/uuid-doctrine with dbal:4.0 though (your repo has a limitation dbal:3.0).

I'll probably figure it our myself, but if you have an idea where the issue might be I would be grateful.

tasselchof avatar Apr 16 '24 11:04 tasselchof

we are planning the switch to doctrine 3 and dbal 4 , in the version 5 of the API https://github.com/orgs/dotkernel/projects/13

So is not tested at all with DBAL 4 . Right now we are focused on documenting all packages https://github.com/orgs/dotkernel/projects/17

arhimede avatar Apr 16 '24 11:04 arhimede

Do you think it’s related?

tasselchof avatar Apr 16 '24 12:04 tasselchof

@tasselchof not necessarily related, but at least the initial stack is stable ( with dbal 3) .

Is a type related issue.

arhimede avatar Apr 16 '24 12:04 arhimede

@arhimede the problem is in uuid type, I guess something about this one: https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-changes-to-handling-binary-fields.

tasselchof avatar Apr 16 '24 16:04 tasselchof

@arhimede the problem is in uuid type, I guess something about this one: https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-changes-to-handling-binary-fields.

Better go back to DBAL 3 and play there...

arhimede avatar Apr 17 '24 09:04 arhimede

I just fixed the types provided by Ramsey/doctrine-uuid, and they are now working with dbal version 4.0.1. However, I am not sure if this library will be updated soon enough. I mean, I can submit a pull request here, but it's obviously going to be more than just "updating the version": https://github.com/ramsey/uuid-doctrine/pull/247.

tasselchof avatar Apr 17 '24 09:04 tasselchof