- Issue created by @jurgenhaas
- π©πͺGermany jurgenhaas Gottmadingen
The error is caused by
\Drupal\eca_form\HookHandler::inlineEntityFormAfterBuild
. When I disable that callback by inserting areturn $form;
into the first line of it, the error disappears.The problem is that IEF is not creating the correct embedded entity, at the same time there are no error messages or exceptions whatsoever.
- π©πͺGermany jurgenhaas Gottmadingen
Also, selecting an existing entity in such complex IEFs doesn't work either. See also π Nested IEF (complex form) stopped working for inner form Active .
A matter of fact, IEFs with the simple widget are not affected.
I'll start with an MR to disable the hook handler for complex IEFs so that people can use that patch until we've found a proper solution for this.
- π©πͺGermany jurgenhaas Gottmadingen
Turn out, when we revert the "bugfix" from π An error occurred while trying to build an inline entity from submitted form values Fixed then the issue disappears as well.
- Merge request !446Issue #3469697 by jurgenhaas: ECA Form breaks complex IEF widget β (Merged) created by jurgenhaas
- Status changed to Needs work
6 months ago 1:27pm 22 August 2024 - π©πͺGermany jurgenhaas Gottmadingen
I've now disabled that code block from the other bug fix, but only for complex IEF widgets. This is just a workaround, but that can be applied to avoid that issue for now.
-
jurgenhaas β
committed 1b2c2c36 on 2.0.x
Issue #3469697 by jurgenhaas: ECA Form breaks complex IEF widget
-
jurgenhaas β
committed 1b2c2c36 on 2.0.x
-
jurgenhaas β
committed b67cc77d on 2.1.x
Issue #3469697 by jurgenhaas: ECA Form breaks complex IEF widget
-
jurgenhaas β
committed b67cc77d on 2.1.x
- π©πͺGermany jurgenhaas Gottmadingen
I have now disabled that complex widget hook entirely until we get a solution for this.
- π©πͺGermany jurgenhaas Gottmadingen
Turns out, disabling complex widgets entirely breaks some existing models, that otherwise with the workaround from the MR would be OK.
So, we're now merging and back porting the MR, publish another bug fix release and then hope that we can still find a proper solution for the underlying problem. But at least we would not be breaking anything in the meantime.
-
jurgenhaas β
committed 6e183c9e on 2.1.x
Issue #3469697 by jurgenhaas: ECA Form breaks complex IEF widget
-
jurgenhaas β
committed 6e183c9e on 2.1.x
-
jurgenhaas β
committed b371ed90 on 2.0.x
Issue #3469697 by jurgenhaas: ECA Form breaks complex IEF widget (...
-
jurgenhaas β
committed b371ed90 on 2.0.x
-
jurgenhaas β
committed 4afdbde7 on 2.1.x
Issue #3469697 by jurgenhaas: ECA Form breaks complex IEF widget
-
jurgenhaas β
committed 4afdbde7 on 2.1.x
-
jurgenhaas β
committed 38c25cdb on 2.0.x
Issue #3469697 by jurgenhaas: ECA Form breaks complex IEF widget (...
-
jurgenhaas β
committed 38c25cdb on 2.0.x
- π¬π§United Kingdom lexsoft London
@jurgenhaas
Upgrading ECA from version 1.x to 2.x on Drupal 10.3.7 generates a warning related to the use of eca_form alongside inline_entity_form 3.x when initializing content entities using the complex widget with AJAX. The warning message displayed is:
βAn error occurred while trying to build an inline entity from submitted form values. This might be a problem if you are using ECA to extend inline entity forms. Please report this to the ECA issue queue to help us improve it.β
Upon investigation, it appears that the condition in the code checks for:
if ($form['#eca_ief_info']['widget_plugin_id'] !== 'inline_entity_form_complex') {
However, in our case, we are using the IEF Table View Mode module https://www.drupal.org/project/ief_table_view_mode β . I would like to suggest modifying this condition to use a regular expression that matches inline_entity_form_complex, which would also account for custom plugins. This change could help ensure broader compatibility.
- π¬π§United Kingdom lexsoft London
lexsoft β changed the visibility of the branch 3469697-eca-form-breaks to hidden.
- π¬π§United Kingdom lexsoft London
I'm having the same issue as @jurgenhaas described in https://www.drupal.org/project/drupal/issues/3405115 π Argument #1 ($values) must be of type array, null given. Postponed: needs info
Is there a Drupal core patch fix for it? - πΊπΈUnited States freelock Seattle
We are hitting this issue on a bunch of sites -- or rather π Integrity constraint violation when trying to add multiple blocks in a complex IEF field Active , which I did not think ECA had anything to do with until someone left a comment there about ECA. All of the affected sites have ECA enabled. Here's the gist of what we're doing:
1. Install IEF, ECA Form modules
2. Create a "featured block" entity reference field on a content type, e.g. "Basic Page", referencing content blocks.
3. Set the field to use the complex IEF widget
4. Create a new page, and create a new block using the IEF widget.If you save now, everything is fine. If you edit the page and add another block, it works fine -- so long as you only ever add one block at a time.
5. If you add a second block without saving the node, it appears correct -- it adds another row to the IEF widget, and you can keep adding more.
6. But if you save, you get the Integrity Constraint Violation, duplicate entry 'xxx' for key 'node__field_uuid_value'.This is affecting node and taxonomy term references as well as block references -- anywhere the IEF complex widget is used with multiple cardinality, if eca_form module is enabled. Doesn't matter if there's an ECA model using it.
- π©πͺGermany jurgenhaas Gottmadingen
Thanks @freelock for the analysis. I will have to debug this, and it reminds me of π Entity Form: Build Entity can't process unlimited values Active which also has some strange behaviour for multi value fields.
- πΊπΈUnited States freelock Seattle
That issue does sound very similar. One difference is that we were seeing the issue with limited cardinality, too -- although a cardinality of 6... but I'm guessing if ECA is replacing the form_state for some reason that might do it...