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

Fix cloning did not correctly apply all previous values #42

Open
wants to merge 1 commit into
base: v1.3-dev
Choose a base branch
from

Conversation

shavounet
Copy link
Contributor

Issue

With a full CDM, using a "clone" action on an entity (with possibly embedded data) did not copied all values (only a subset...).

Solution

Still not sure why it works, but using \Sidus\EAVModelBundle\Entity\AbstractData::addValue helped...

After this change there was a second error in admin, from a twig template vendor/cleverage/eav-manager/LayoutBundle/Resources/views/Form/form.fields.html.twig:184, because the embedded data did not have an id. I removed the "clone embedded data" behaviour from \Sidus\EAVModelBundle\Entity\AbstractValue::__clone because

  • it couldn't work in admin as-is
  • I'm not sure it's always a desired behaviour... (at least for me it's not I believe) maybe it should be a dedicated attribute option ?

This last change could be a breaking one.

@shavounet
Copy link
Contributor Author

  • I'm not sure it's always a desired behaviour... (at least for me it's not I believe) maybe it should be a dedicated attribute option ?

I was wrong, but anyway there is a weird case to handle in admin...

@shavounet
Copy link
Contributor Author

  • I'm not sure it's always a desired behaviour... (at least for me it's not I believe) maybe it should be a dedicated attribute option ?

I was wrong, but anyway there is a weird case to handle in admin...

I've rollback my change on cloning embedded entities, though there's still an issue to handle because there is no id for cloned embedded entities and twig do not handle this.
image

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

Successfully merging this pull request may close these issues.

1 participant