- Issue created by @gge
- 🇷🇴Romania gge
Back with additional information:
All the values are correctly displayed when the node is created if the field is not unlimited.
Now the question is how can we get all the values if the field is unlimited?
Thank you!
- 🇩🇪Germany jurgenhaas Gottmadingen
I haven't tested it yet, but looking at the code in
\Drupal\eca_form\Plugin\Action\FormBuildEntity::execute
, ECA just calls$form_object->buildEntity($form, $form_state)
at the very end. That's all from Drupal core, and if anything went wrong, that would indicate a core issue.There is one line that may indicate another source of the issue: on line 136 the form object gets cloned with
$form_object = clone $form_object;
. I've seen core issues when cloning an entity before.You could try 2 things: either test the whole thing with that cloning removed? This wouldn't be for your production site, just to test if that makes any difference. If it doesn't, then you may want to use xdebug and go through that
$form_object->buildEntity
to see where it goes wrong. - 🇷🇴Romania gge
When commenting out
$form_object = clone $form_object;
all the values are displayed on node add, the issue seems to be solved, but are there any side effects if that line is removed?Thanks!
- 🇩🇪Germany jurgenhaas Gottmadingen
When commenting out $form_object = clone $form_object; all the values are displayed on node add
This is great news.
are there any side effects if that line is removed?
Probably yes. It's in there so that we can be certain not to create any unintended changes to the form object.
With your test results it sound pretty certain that there is a core issue with cloning the entity. In order to report this as a bug in the drupal issue queue, you would require more details so that one would know what's wrong. As a starting point, I'd do a comparison of the form object in the cloned and non-cloned version. Maybe that provides some indication.
Unfortunately, I currently can't offer more time for this as DrupalCon and a few other commitments are very demanding.