If use Inline Entity Form - Complex allow create new entity which with image field,the second new entity's image field will keep the first new entity's image field value,remove image value in second and the first will be remove too.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ipumpkin created an issue. See original summary.

ipumpkin’s picture

Status: Active » Needs review
FileSize
3.13 KB

Status: Needs review » Needs work

The last submitted patch, 2: file_field_keep_pre_value-2886023-2.patch, failed testing. View results

lykyd’s picture

Applying #2 patch fixed the issue but broke the "Cancel" and "Add an existing" buttons.

lykyd’s picture

Here is the solution I came up with. Based on @ipumpkin patch, just extending it to "Add existing" button and a little fix for the "Cancel".

lykyd’s picture

agolubic’s picture

@lykyd Your patch (#5) is great, but You got typo on 15 and 21 line of Your patch (You put only one + instead of ++ :)). I added 'missing' + in Your patch. After typo fix it works great, fixes the issue and cancel button works.
Thank You for Your patches @lykyd and @ipumpkin!

ipumpkin’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 7: inline_entity_form-file_field_keep_pre_value-2886023-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

lykyd’s picture

I have upgraded to Drupal 8.5.3 + IEF 8.x-1.0-rc1 and the patch does not seem to be useful anymore.
On the contrary, using it create an Ajax error when trying to create an entity.

mbovan’s picture

This sounds like #2653574: Unable to keep nested IEF data separate with multivalue fields.. Could you please test, @ipumpkin?

RoloDMonkey’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#2653574: Unable to keep nested IEF data separate with multivalue fields.

I saw this same behavior, and can confirm that this is a duplicate of #2653574: Unable to keep nested IEF data separate with multivalue fields.. Applying the patch on comment 100 resolved the issue for me.