Skip Navigation

[Resolved] Image layout can't be replaced in image field of front-end form

This support ticket is created 5 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 9 replies, has 3 voices.

Last updated by Nigel 4 years, 4 months ago.

Assisted by: Nigel.

Author
Posts
#1465535
featured2.jpg
featured1.jpg

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.

#1465793

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.

Thanks!

#1466459
after-replace.jpg
only-thumb.png

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).

#1470619

No, there is no such inbuilt feature in Forms. It uses the thumbnail, if available
You'd have to suggest a new feature to customize this further at https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

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.

I'll report this and doing so as well request a better control which then would also support your suggestion that I mentioned sending to https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

I'll keep you in the loop about eventual fixes or changes.

For now, unfortunately, there is no immediate solution.

#1470687

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.

#1470693

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.

#1478601

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.

#1484193

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.

Please let me know.

#1485341

I would appreciate knowing when this gets redesigned.

#1778623

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Eric

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.