I am trying to replace the image in the Featured Image field on a front-end form. When the form first appears, it looks like attached image "featured1.jpg".
I click the Replace Image button and select an image to use. Once I close the Media Library window, the new image has not replaced the original, instead the new images is shown below it. See "featured2.jpg".
The changes also won't save so I can't tell if the featured image actually gets replaced. I will create a new ticket for that issue.
To replicate the bug:
1. Login using information below.
2. On the next page, click the button "Edit Lodge Details"
3. Try to replace the large image at the top.
The default output of Forms Featured Images before editing it is the 150 px thumbnail, I see however a bigger image on your example.
Did you customize the default size of the Forms featured image field preview?
I ask because I cannot replicate the issue where the image is not replacing the older, hence it could be that any custom code put in place is interfering with the core Toolset Forms features.
I can also see JS errors that can interfere with AJAXified and JS features of the Form, in the console of your example:
Uncaught ReferenceError: wpmf is not defined
I suggest ensuring this issue is not due to customizations, and report back to me (if any) which customizations provoked the issue, so maybe we can adjust or find a fix for it.
I'm using a view to display the form, and in the view, before I render the form I output the featured image in full-size, to better replicate how the post looks on the front end. I couldn't find a way to output the full-size featured image instead of a thumbnail. Then I was hiding the thumbnail with CSS. My plan was to detect when the featured image had been changed, and re-load the full-size featured image. I had forgotten about this.
Is there a way to output the full size featured image as part of the form rather than the 150x150 thumbnail?
I have now removed the output of the full-size featured image (see only-thumb.png).
Things are working a little more as one would expect, however, now after I try to replace the image and select a new one, the featured image thumbnail is replaced by the full-size image that was selected, NOT A THUMBNAIL OF IT. See after-replace.jpg.
If the form shows a thumbnail to begin with, the replacement should also be a thumbnail. Or, if I am able to show a full-size image to begin with, then replacing it with a full-size image is acceptable (and preferred). Either way, it should be consistent.
Can this be done?
BTW, I'm aware of that "Uncaught ReferenceError: wpmf is not defined" error...it is due to another plugin, but I've confirmed that disabling the plugin does not affect the form (other than preventing that error from being thrown).
I agree however, there is a need to improve this when using the WordPress media uploader.
I see that we display the thumbnail (if available) but we show the medium size if uploading fresh - EVEN if we upload with the media uploader which runs thru the thumbnail generation process.
Is it possible to hook into the action of replacing the image? So that I could have some code watch for a new image and retrieve and display the thumbnail for it, and replace the medium-sized image that gets loaded.
The only hook available at this time and point is cred_form_ajax_upload_validate, and it only offers an array of possible errors to trigger, I doubt you can display a different image with it.
I will keep you in the loop on possible workarounds and solutions.
I've managed to create my own workaround which will do for now. But a more well thought-out design for this feature would likely help others in the future save a lot of time.
I have created an internal task and will ask the Developers to take a look at this so to unify the appearance.
Likely, we will have to show always the size determined by the Theme by default (like it is after uploading on an edit form), instead of using a thumbnail at any time.
I can, if you want, keep you in the loop of the progress in this ticket.
I see from the internal tickets that this was marked as fixed in the latest batch of releases that were published yesterday.
From the description it sounds like an attribute was added so that you can specify what size the image should be previewed at.
I haven't checked it, but I suspect you will need to edit the forms involved, specifically the fields in question in those forms, to see the available options.
If it is not clear, please let me know and I'll investigate.