Saltar navegación

[Cerrado] Still issues after applying your code fix

This support ticket is created hace 7 meses, 2 semanas. 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 – 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 -

Zona horaria del colaborador: America/Sao_Paulo (GMT-03:00)

Este tema contiene 2 respuestas, tiene 1 mensaje.

Última actualización por kristofG hace 7 meses, 2 semanas.

Asistido por: Mateus Getulio.

Autor
Mensajes
#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 enlace oculto
I have reverted the code on the original site enlace oculto and there the correct images are being displayed.

#2783337

Mateus Getulio
Colaborador

Idiomas: Inglés (English )

Zona horaria: 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 enlace oculto 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.

El debate ‘[Cerrado] Still issues after applying your code fix’ está cerrado y no admite más respuestas.