Skip Navigation

[Closed] Still issues after applying your code fix

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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 2 replies, has 1 voice.

Last updated by kristofG 1 month, 1 week ago.

Assisted by: Mateus Getulio.

Author
Posts
#2783141

Hi,

referencing: https://toolset.com/forums/topic/images-gallery-missing/

While the images are now being displayed thanks to your code in mentioned support ticket. On this property, the wrong images are being loaded hidden link
I have reverted the code on the original site hidden link and there the correct images are being displayed.

#2783337

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Kristof,

The previous modification focused on ensuring that media IDs were correctly retrieved by matching filenames in the database without considering domain specifics. This was a simple change that aimed to fix an issue with the custom code getting the wrong site url when calling the Avada gallery shortcode.

Custom code like this can involve complex logic that might vary greatly between setups.

While I can point out where the logic might need more refinement, as I did in the last ticket, diving deeper into such code falls outside the scope of our standard support. I highly recommend consulting with one of our Toolset Certified Contractors who can assist with advanced customizations to your site's code and troubleshoot these nuanced issues more effectively:

https://toolset.com/contractors/

This will ensure that your custom setup is setup correctly and functions as expected across different environments.

Best regards,
Mateus

#2783430

I think I have found the solution. I had a look at the original code and saw '"SELECT ID FROM $wpdb->posts WHERE guid = %s",
$image'
I know that when duplicating a site, the GUID is not replaced and will always point to the original site.
I did a replace DB and first with your proposed code, it did not change anything, but then I reverted back to the original code and now the correct images load on both sites.
The confusion in the DB must come from equally names images on both sites but in different folders, and basename does not take path into account, so DOMAIN-A/01/15-1.jpg 'looks' the same as DOMAIN-B/05/15-1.jpg. And /01/15-1.jpg will be the first hit when browsing through the folders in the /uploads/ folder, but that property needed /05/15-1.jpg. I got triggered because on hidden link some images were correct (/05/ folder) but other images were taken from /01/. If it were a certain code error, either no images would load or all would be wrong, not a mix of correct and wrong images.

The topic ‘[Closed] Still issues after applying your code fix’ is closed to new replies.