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

Deserialize Embedded #790

Closed
elvispdosreis opened this issue Mar 19, 2020 · 8 comments
Closed

Deserialize Embedded #790

elvispdosreis opened this issue Mar 19, 2020 · 8 comments
Assignees

Comments

@elvispdosreis
Copy link

I have an Embedded class, but when deserializing it, I try to select the class
An exception occurred while executing SELECT ... FROM Promotion t0 Table database.Promotion doesn't exist

     /**
     * @ORM\Embedded(class="Promotion", columnPrefix=false)
     * @JMS\Type("App\Domain\Promotion")
     * @JMS\Groups ({"list", "details"})
     */
    private $promotion;

however it is an Embedded class

@goetas
Copy link
Collaborator

goetas commented Mar 24, 2020

It seems that it tries to load the entity rather than creating a new class.

Are you sure that Promotion is not defined as entity?

@elvispdosreis
Copy link
Author

the problem happens only in those who are using doctrine 2.7.1 or higher I downgraded to 2.7.0 and returned to work

@goetas
Copy link
Collaborator

goetas commented Mar 25, 2020

This is caused by doctrine/orm#8006. I have commented on that PR.

@goetas
Copy link
Collaborator

goetas commented Apr 4, 2020

ive spent some time trying to debug this, but no results so far. can you please share the Promotion class code and the other class that is using it as embedded?

@elvispdosreis
Copy link
Author

Yes

class.zip

@goetas
Copy link
Collaborator

goetas commented Apr 18, 2020

I've tried to reproduce this but again with no luck. Which version of the serializer library are you using?

Can you please send a pull request with a failing test case? https://github.com/schmittjoh/serializer/blob/master/tests/Serializer/Doctrine/ObjectConstructorTest.php is place where you can add your test case

@elvispdosreis
Copy link
Author

elvispdosreis commented Apr 20, 2020 via email

@goetas
Copy link
Collaborator

goetas commented Apr 21, 2020

Now I understand.
"jms/serializer": "^1.14.1" is not maintained anymore. The issue that you are reporting the probably has already been fixed in schmittjoh/serializer#1031, available as of 3.1.0

@goetas goetas closed this as completed Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants