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
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
Comment #2
loze commentedThanks 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.
Comment #3
wwwahe commentedI still have the issue on the 1.0.x branch
Comment #4
loze commentedHmm, 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.
Comment #5
wwwahe commentedMy 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.
Comment #6
loze commentedThanks for the update. I will look into it when I have some time.
Comment #7
wwwahe commentedComment #9
loze commentedI 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 hookssubmitEntityForm()onto the submit, publish, and unpublish buttons. The preview button is not included, soEntityFormDisplay::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