Skip Navigation

[Resolved] Changing Images in Types Image Field keeps previous image atteched to post

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

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 2 replies, has 2 voices.

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

Assisted by: Minesh.

Author
Posts
#1879559

Hi Toolset Team

I added a Types image field to a custom post type, which all works great.

But then on exporting the posts with all the custom fields, I noticed that in some cases the posts had multiple images as attachments.

On a closer look I noticed that this only happens when I change or updated an existing image. The more I change the image, the longer the list grows.

Example: "Image One" gets updated with "Image Two" then both show as attached to the same post.

Of course, after I found out, I could detach/remove the old attached images manually via the Media Library, but with a few hundred or even thousands of images, this could turn into a tedious task.

I think it would be great if on update/change of an image the existing image would be automatically detached.

What happens, is that this can lead to conflicts and issues in some Import / Export / Migration scenarios. At least there it was when I noticed this behavior.

Any hints are very welcome

#1880193

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I just created a test site with Types plugin and created Movie post type which have movie-pic as custom image field.

Then I try to add the first post for movie post type and try to add the image, at this time as this is brand new WP install, I uploaded the 5 images and then selected the 1 of them for my custom image field movie-pic and when I see the post meta table, I can see the correct image is assigned to post meta key wpcf-movie-key.

But when I see the post table and filter the post table with the post ID (for example: 9) and post type equal to attachment, I can see 5 entries as I uploaded 5 images.

We can not delete the attachment post as the uploaded images can be used by others. Please let me know if I misunderstood anything here.

#1880203

Hi Minesh

Thanks for your reply and testing this issue.

It looks like it's just another fundamental flaw in the WordPress Concept, but after all - its still just a blogging System - patched with so much BandAid around that it is about to become a mummy ... 😉

My issue is resolved now. Thank you!