Skip Navigation

[Resuelto] Google maps issue and Convert Cache error

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:

The issue here is that the user was getting the error "Progress: An unknown error has happened." when trying to convert maps to the new caching system.

Solution:

This issue can be resolved by running the following sql query.

alter table wp_postmeta convert to character set utf8mb4 collate utf8mb4_unicode_520_ci;
This support ticket is created hace 5 años, 4 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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

Supporter timezone: America/Jamaica (GMT-05:00)

Etiquetado: 

Este tema contiene 22 respuestas, tiene 3 mensajes.

Última actualización por Valeriia hace 5 años, 3 meses.

Asistido por: Shane.

Autor
Mensajes
#1292871

Hi,

Starting from some time ago, on all my sites I see a notice:

Toolset Maps: You've got some address data cached. Convert it to a new, more efficient format to gain significant performance benefits on Troubleshooting Page!

When I go to the Troubleshooting Page and click Convert Cache, I get the following:

The action is now completed.
Progress: An unknown error has happened.

The response is consistent throughout all my sites. Is it supposed to be like that?

Besides, the maps don't work as expected. For example, I select a location in Address field and output it on the map via php:

if (!empty($location)) {
	echo '<div class="single_map">';
	echo do_shortcode('[wpv-map-render map_id="map-'.$post_id.'" map_width="100%" map_height="400px" single_zoom="'.$map_zoom.'"][/wpv-map-render]');
	foreach ($location as $key => $marker) {
		$number = $key+1;
		echo do_shortcode("[wpv-map-marker map_id='map-".$post_id."' marker_id='marker-".$number."' marker_title='".$marker."' marker_field='wpcf-location']".$marker."[/wpv-map-marker]");
	}
	echo '</div>';
}

If I print_r() the $location, it gives the correct data, for example: Array ( [0] => Peterhof, Saint Petersburg, Russia )

But on the map, when I click on the marker, I see the name of a completely different place that was chosen once in another article: Altai Krai, Russia. I see that name on every map I add. You can check it yourself here: enlace oculto (at the bottom of the article).

Am I doing something wrong or it's a bug?

Thank you.

#1292953

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Valeriia,

Thank you for getting in touch.

Perhaps you need to check what is actually in the $marker variable at each stage.

Using a var_dump or print_r to check the array to ensure that all the correct information is there.

Thanks,
Shane

#1292963

Hi Shane,

As I said in my first message, I print_r() the $location which gave "Array ( [0] => Peterhof, Saint Petersburg, Russia )"

I also echoed $key and $marker with: "echo $key . ' ' . $marker" which gave me "0 Peterhof, Saint Petersburg, Russia".

I'm sorry to say, but your gave me a bit of a lazy answer. Plus, you did not comment at all on the Convert Cache error.

#1292969

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Valeriia,

In order to understand the caching error I would need to have access to one of the sites where you are experiencing this.

I also noticed this this Array ( [0] => Peterhof, Saint Petersburg, Russia ) in your message but your $marker is clearly giving something different which it shouldn't.

Would it be possible to get access to this site so that I can do a thorough check on your code to see why this is happening ?

If not then would you mind providing me with a copy of the site using the duplicator plugin ?

Thanks,
Shane

#1295083

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Veleriia,

It could be your caching plugin causing interference with the map because it works fine in my testing but a little inconsistent even when nothing has changed.

Could also be why the cache conversion for the map isn't working either.

I would try disabling the plugin to see what would happen but in my testing with the map the correct location is shown but the incorrect name even though the marker data is the same. I noticed if I add some text before the marker data it also shows up correctly as well.

Thanks,
Shane

#1295473

Hi Shane,

Thanks for looking into it. I disabled the plugin and it did not change anything. Still the same error and incorrect location displayed.

But it made me thinking: I'm using Cloudflare on this website, can it be the reason? Is your Maps plugin tested with Cloudflare?

Although I don't use Cloudflare on other websites and still can't convert cache with the same error. Can't say about maps as it's the only place where I use them for now.

#1297817

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Valeriia,

I've investigated the issue for you and found that it was being generated by this error here.


WordPress database error COLLATION 'utf8_general_ci' is not valid for CHARACTER SET 'utf8mb4' for query CREATE TABLE wp_toolset_maps_address_cache (
			address_passed varchar(190) NOT NULL, 
			address varchar(255) NOT NULL, 
			point point NOT NULL,
			PRIMARY KEY  (address_passed)
		) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8_general_ci made by do_action('wp_ajax_toolset_maps_update_address_cache'), WP_Hook->do_action, WP_Hook->apply_filters, Toolset_Ajax->__call, Toolset_Maps_Ajax_Handler_Update_Address_Cache->process_call, OTGS\Toolset\Maps\Controller\Cache\CreateDatabaseTable::run, dbDelta

I've reported this to our team to see if there can be a fix for this.

Thanks,
Shane

#1298239

Great, thank you.

I'll be waiting for your updates.

#1298603

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Valeriia,

Could you try using this sql code to alter the table for the wp_postmeta?


alter table wp_postmeta convert to character set utf8mb4 collate utf8mb4_unicode_520_ci;

This should fix the issue.

Thanks,
Shane

#1301193

Hi Shane,

The query does not run due to an error: "missing comma before start of a new alter operation (near character set)".

I'm not too good in MySQL, could you correct it?

#1301611

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Valeriia,

I was presented with the same error as well but the query still ran for me.

When you click the go button in your mysql or phpadmin dashboard does the query not run at all ? The query is actually correct to me.

Please let me know.

Thanks,
Shane

#1307555

Hello Shane,

Sorry for the delay, I've been travelling.

I run the query and it solved the issue of "Convert Cache". But the marker on the map is still wrong.

#1308285

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Valeriia,

This should be working.

All I did was to give some space in the php code of the map marker render shortcode.

Thanks,
Shane

#1309255

Hi Shane,

I see the spaces you added but it's not working. It still shows Altai for all the markers on the site.

#1309735

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Valeriia,

I think the problem is being generated from the foreach loop.

Perhaps you can restructure and not use the foreach but to use an if statement to check the 0 index of the location variable.

In this case I dont think the foreach is needed since its only 1 instance of the address.

Thanks,
Shane