Skip to content

Handle ENUM Primary Key in ObjectHydrator.php #11053

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

Closed
wants to merge 3 commits into from

Conversation

wucdbm
Copy link
Contributor

@wucdbm wucdbm commented Nov 7, 2023

Where App\Core\Nomenclature\Country is an ENUM used as a Primary Key of a relation, so it tries to cast it to string -- should be simple enough to reproduce, I an not allowed proper time to create a proper PR with tests and all

I've fixed it on our end by copying the source file and applying the same patch, I hope this helps

Error:
Object of class App\Core\Nomenclature\Country could not be converted to string

at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1903
at Doctrine\ORM\UnitOfWork->tryGetByIdHash(object(Country), 'App\Core\Entity\Location\CountryGroupCountry')
(vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:304)
at Doctrine\ORM\Internal\Hydration\ObjectHydrator->getEntityFromIdentityMap('App\Core\Entity\Location\CountryGroupCountry', array('id' => object(Country)))
(vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:403)

@wucdbm wucdbm changed the base branch from 2.16.x to 2.17.x January 21, 2024 19:50
@wucdbm
Copy link
Contributor Author

wucdbm commented Jan 21, 2024

@derrabus I've no clue where/how to test this one, please advice

@derrabus
Copy link
Member

Create a functional test that reproduces your problem. We have plenty of those. Have a look at the existing tests and you should figure it out.

Copy link
Contributor

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
If you want to continue working on it, please leave a comment.

@github-actions github-actions bot added the Stale label Oct 18, 2024
Copy link
Contributor

This pull request was closed due to inactivity.

@github-actions github-actions bot closed this Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants