Skip to content

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