Skip Navigation

[Resolved] Featured Images Disappearing

This support ticket is created 3 years, 8 months 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 10 replies, has 2 voices.

Last updated by Minesh 3 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#1991277

Hi, one of our customers complain that, randomly, some featured image connection disappear.
It's a CPT created with Types.

I cannot reproduce myself this behavior, so I thought I ask if you may have had any similar case before.

Thanks for any suggestion.

#1991715

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I do not see any other user reported such issue as well as I do not remember such case recently.

If user says there must be the case but in order to investigate the issue further the issue should be reproduced but as you acknowledged that you do not able to reproduce it.

I'm not sure but can you please check with your clients and see what steps they are following and try to follow the same steps or what actions they are taking or check for compatibility as well and see if you can able to see the issue.

#1993175

We could isolate the problem.
We built a Form to edit the custom post in front-end, which contain also a field for the featured image:

<div class="form-group col-md-6">
			<label>[cred_i18n name='_featured_image-label']Featuring Bild[/cred_i18n]</label>
			[cred_field field='_featured_image' output='bootstrap' previewsize='thumbnail']
</div>

When we open this form from the post, the Featured Image field is properly populated with the current Featured Image.
But as soon as we re-save the form the image is gone.

If we insert the picture manually it works.

hidden link

Any idea?

#1993333

Minesh
Supporter

Languages: English (English )

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

Yes - I can see with the video you shared.

But then I've run a test with my test with edit form where featured image is available for edit and when I try to submit the form without changing the featured image value, it works just fine.

you can see the form on the following page:
=> hidden link

user: demo
pwd: Admin@999

#1993971

Found the problem.
When the Bunny CDN plugin is activated, the Featured Image won't be saved.

Disabling the plugin did the trick.
Interesting would be to know why.
I wrote also to Bunny's support.

#1994077

... and here is the answer from Bunny's support:

"..sometimes integrating the CDN with our plugin won't work due to conflicts with others, I believe this is one of those instances where Toolset would have to provide functionality to integrate a CDN with their product, unfortunately this isn't something we're able to do from our side of things."

#1995941

Minesh
Supporter

Languages: English (English )

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

We have a known issue with uploading/updating image files when using amazon s3 and cloudfront plugins.
=> https://toolset.com/errata/issues-with-saving-images-and-media-fields-in-toolset-forms-when-using-amazon-s3-and-cloudfront-plugins/

But this should be also the same conflict with the Bunny CDN plugin.

if you can share problem URL Where I can access the edit form as well as admin access details, I would be happy to check and see if I can able to share any workaround for this compatibility.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1998441

Yes, it looks like this could be the problem.
But being a real-estate live site, with a good amount of pictures, I would prefer a stable Form's version than a workaround.

You could maybe remind again this to 2nd tier, as the errata seems to be years old.

#1998595

Minesh
Supporter

Languages: English (English )

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

It could be considered as compatibility issue with Bunny CDN plugin (and to setup a test to test compatibility for CDN is not straight forward as it requires use other addon services) and it will take a long time as compatibility issues are not going to fixed within couple of days as its totally depends on predefined priorities of our Devs as well as how the Bunny CDN plugin author co-operates. It also depends on how many user requesting this compatibility. I see you are the first one.

However - I'll take a note of this and will discuss with our 2nd tier. The quick way to solve this is using the workaround for now. Please let me know if you are agree on this and I'll try to share the workaround.

#2000991

Being a 3rd part work, containing a lot of confidential customer's information, I would need a special authorization to share admin details.
If you could pass along the workaround, I could try myself to implement it.

By the way, the plugin is created by the Bunny CDN devs.
Being one of the top CDN of the world, like Cloudflare, I would suggest that a compatibility solution would be at least welcome (if not mandatory).
I am the only one having this problem? Could be, but I wouldn't be so sure.
Maybe other people simply avoid using Toolset, because of this 😉

#2001811

Minesh
Supporter

Languages: English (English )

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

We have updated the errata page and added Bunny CDN as well.
=> https://toolset.com/errata/issues-with-saving-images-and-media-fields-in-toolset-forms-when-using-amazon-s3-and-cloudfront-plugins/

Can you please try to use the following workaround.
You should try to add the following code to "Custom Code" section offered by Toolset:
=> https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/
OR
Add it to your current theme's functions.php file:

function set_custom_featured_image( $post_id, $form_data ) {
 
 $forms = array( 9999,1111);
  if ( in_array( $form_data['id'], $forms ) ){
  
     $url = $_POST['_featured_image'] ? $_POST['_featured_image'] : '';

    $thumb_id = attachment_url_to_postid($url)
    // set the _thumbnail_id post meta with this id
    update_post_meta( $post_id, '_thumbnail_id', $thumb_id );
 }
}
add_action( 'cred_save_data', 'set_custom_featured_image', 10, 2 );

Where:
- Please replace 9999 and 1111 with original form IDs.

Hopefully the workaround should work. Please let me know if you require further help on this.