Skip Navigation

[Resolved] featured image for CPT gets deleted when editing using Post Form

This thread is resolved. Here is a description of the problem and solution.

Problem:

Featured image lost after submut the Toolset form.

Solution:

This is a compatibility issue with "Kinsta Must-use Plugins", see details here:

https://toolset.com/forums/topic/featured-image-for-cpt-gets-deleted-when-editing-using-post-form/#post-1577131

Relevant Documentation:

This support ticket is created 4 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 10 replies, has 3 voices.

Last updated by jeffM-14 3 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1555129

When I edit a Custom Post Type that has an attached Featured Image (I am using this for a member profile pic), the existing image gets removed when the form is saved.

hidden link
You can use credentials:
username: tester
password: NW#Q$jjMaQugVK%7yF9eti6$

If you click the "Edit Profile" link and change anything but leave the photo as is, then save the form, the existing image gets removed.

Why does this happen? How can I get the existing featured image for existing profiles to stay when editing the CPT?

#1555803

Hello,

Thanks for the details, I can see the problem in your website, and I have tried it in my localhost with a fresh WordPress installation + the latest version of Toolset plugins, it works fine, so the problem is abnormal, please check these:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP code snippets, and test again

2) Also check if there is any PHP error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

3) If the problem still persists, please provide database dump file(ZIP file) of your website, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1559075

Thank You for the reply. I will test your suggestion tomorrow. Please keep this ticket open until I give another update.

#1559313

I have marked this thread as waiting for feedback status, please let me know if you need more assistance for it, and the private message box enabled again.

#1572713

Thank You -- I have moved the site to a staging environment and am having my client test it there. I will let you know.

#1573247

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Luo is having a day off today. He will get in touch with you as soon as he back to work on the coming Monday.

#1575097

I have marked this thread as waiting for feedback status, please let me know if you need more assistance for it, and the private message box enabled again.

#1577131

Okay this is really odd -- I have replicated the website completely to a staging environment and left everything the same (did not change themes, did not disable plugins) and the profile image stays and saves when editing a profile. But it still does not work on the live site. Why would that be?

Here is the staging site profile that you can play with using the credentials I shared before:
hidden link

And here is the live site again:
hidden link

In both environments, click into the "Jeff Mackey" profile and click the Edit Profile link. Change anything you want in the profile and click Submit.

Let me know what access you need to see what's going on. As I said -- other than the URL (obviously) the two environments are identical.

#1578033

It should be a server/compatibility issue, as I mentioned in my first reply:
https://toolset.com/forums/topic/featured-image-for-cpt-gets-deleted-when-editing-using-post-form/#post-1555803

please check these in the live site:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP code snippets, and test again

2) Also check if there is any PHP error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

If you still need assistance to locate the problem, please backup your website first, provide the live website credentials and FTP access in below private message box, thanks

#1580393

In order to get the PHP debug logs, I have tried the SFTP access you provided, but get these error:

Command: Trust new Hostkey: Yes
Error: FATAL ERROR: No supported authentication methods available (server sent: publickey)
Error: Could not connect to server

Please check it.

There are two Must-Use plugins in your website:
hidden link
Especially the "Kinsta Must-use Plugins", it is changing feature image URLs of Toolset Forms to their CDN URLs, that will conduct unexpected result.

I can not disable them without the SFTP access, can you disable them, and test again?

#1581003

That was it!

Your most recent reply made me realize that there was in fact a difference between the live and staging environments: the CDN. On the live site, all images were being sent/served to the CDN. As soon as I turned that off and tested the form with an image, it worked just like it does in the staging.

Much appreciated...

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.