Hello,
I've tested this module which seems very promising.
Here one feedback from my tests:

Problem/Motivation

The image field widget doesn't seem to work while previewing content

Steps to reproduce

- Have a Filepond image widget field inside a media displayed as "inline entity form - Simple" in a entity form
- Fill the field with an image
- Try a preview -> The setted image won't be displayed
- Back to content edition -> The value is removed

Issue fork filepond-3567986

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

wwwahe created an issue. See original summary.

loze’s picture

Status: Active » Needs review

Thanks for pointing this out. I believe this is resolved in the latest dev version that I just pushed up.

Can you try that and let me know.

wwwahe’s picture

I still have the issue on the 1.0.x branch

loze’s picture

Hmm, are you clicking the preview button before the upload completes?

If so I think I need to disable the preview button while upload is happening, as well as the submit button.

The only way I am able to reproduce this is if I click preview button quickly, before the upload is complete. Ill work on that.

wwwahe’s picture

My bad !
This is not directly on a image file field but inside a Media field displayed as "Inline entity form - Simple".
It works well with a Image field directly related to the entity.

loze’s picture

Status: Needs review » Needs work

Thanks for the update. I will look into it when I have some time.

wwwahe’s picture

Title: Not working with entity preview » Not working with inline entity (media) and entity preview
Issue summary: View changes

loze’s picture

I investigated this thoroughly. The IEF support is a two-part issue:

Part 1 (fixed): Form rebuild with correct parents

When FilePond is inside an IEF widget, formElement() needs to read user input using $form['#parents'] (which includes the IEF path) rather than $element['#field_parents'] (which does not). Without this, the widget can't find its submitted fids after a form rebuild, e.g. when returning from node preview back to the edit form. This is fixed in the current branch.

Part 2 (upstream IEF limitation): Preview page rendering

The preview page itself does not show the updated image. This is not a FilePond issue. IEF's ElementSubmit::attach() only hooks submitEntityForm() onto the submit, publish, and unpublish buttons. The preview button is not included, so EntityFormDisplay::extractFormValues() never runs on the child entity during preview. The entity stored in tempstore has stale field values.

This affects all field widgets inside IEF during preview, including core's image widget. I confirmed this independently.

Relevant IEF issues:
#2830829: Entities are not updated during buildEntity() phase
#2932492: "This value should not be null." on node preview

  • loze committed 2eaa10c4 on 1.0.x
    Issue #3567986 Fix FilePond widget losing files inside Inline Entity...