[Gelöst] Views generated image links need to be updated
Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.
Problem: Several custom field images are showing the wrong URL. It appears to be generated using the original image guid.
Solution: Update to Types 3.2 to get the fix for this bug.
This support ticket is created vor 6 Jahren, 2 Monaten. 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.
Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.
Hello, I was working on a clone of this site in a sub-folder called "test" and ended up moving the whole thing back in to the root. I ran a search and replace app to get rid of all instances of "test" (I thought) but the views-generated images that were created while in the test folder still seem to be using the old URL.
For example mysite.com/test/wp-content/uploads/2018/07/theimage-wpcf_1024x1024.jpg, rather than mysite.com/wp-content/uploads/2018/07/theimage-wpcf_1024x1024.jpg. This only applies to images with the views suffix. Is there a cache I can clear somewhere or something as these URLs are not in the database?
Hi Shane, the images do exist on the live site. I only noticed the problem because when I deleted the "test" sub-folder, most of the images broke. If I could have fixed the URLs it would have been fine, but because I couldn't see how to do that, I had to re-clone the live site back to "/test" so that the live site is not full of broken images!
So basically both sites have the full complement of images – they are clones – but on the live site, Views is still generating image links to the old test site for some reason.
On the home page of the live site, you can see for example "Somptueuse Maison …" down at the bottom. That property was added while the site was in the test folder, and still has "/test" in the URL of the image shown on the home page. If you actually click to view the property, all of the image URLs are correct – that content template is generating them correctly, but it seems the one that generated the grid images is not.
It only affects one property on the home page, but many others elsewhere. On the home page, if you search the source code for /test/, you should find it. It's "somptueuse maison…" On the prestige page, it affects most of them from that same property onwards. Those are all the ones that were imported while the site was in the test sub-folder. The ones that don't have 'test' in the image URLs were added more recently.
I have discovered that it can be corrected by manually re-saving the post, but is there a way to do this without manually opening and saving over a hundred posts?
Hi, Shane is on holiday this week so I'm going to try to help. There is a cache of images used by Toolset, and it can be reset by going to Toolset > Settings > Custom Content. Try clearing both cached and outdated cached images first. If that doesn't work, you can try going to the post dashboard, check all the checkboxes, then use the "Bulk Actions" menu to edit the posts simultaneously. Update the posts without making any changes, and see if this solves the problem.
Hi Christian, thanks for your reply, but no, none of that worked. I had already tried clearing the cached images several times. The bulk actions route also didn't work, which is consistent with my experience with that method for other things in the past. It's really very stubborn! Will the cache ever expire by itself?
It's difficult for me to predict the image cache expiration behavior when you have other systems in play, like SG Cache, Views and WPML, which also have their own caching systems. To purge the Views cache, I added the cached="off" attribute to the View shortcode, like this:
[wpv-view name="featured-house" cached="off"]
This temporarily disabled the View cache, which was holding on to the old image references. Then I went to WPML > Assistance Technique > Dépannage to purge the WPML cache. Then I used the top menu to "Purge SG Cache", and now the test image URLs are no longer appearing. Can you check the site and let me know if any test image URLs are still showing?
Hi Christian, no I'm afraid I still see /test in the URL of the background image for "somptueuse maison…" on the home page. I had already cleared the SG cache, and also Cloudflare several times before starting this thread so they should not have been a factor. If it really can't be sorted any other way, then it's not the end of the world, it just means I'm using up quite a lot of extra server space by having to have a duplicate of the site in the test folder.
You're right, I'm not sure how I overlooked that yesterday during testing but it's obviously not working. I'd like to do some deeper investigation if that's okay with you. I'd like to create a clone of this site to see what's going on in the database, and report any potential bugs to my team. If you approve, I'll install the Duplicator plugin and create that clone so I can run tests locally without causing problems on your live site.
Hi Christian, more than happy for you to do this, the only issue is that I already have a clone of the site on the server and the images for all of those properties take up a lot of space. I have removed a backup from the server, so there should be enough space to create a Duplicator package, but please remove it afterwards. Thanks very much!