mcguffin / acf-openstreetmap-field

WordPress ACF Field for OpenStreetMap
https://wordpress.org/plugins/acf-openstreetmap-field/
GNU General Public License v3.0
107 stars 21 forks source link

The plugin stopped working in version 1.5.4. #107

Open noografo opened 8 months ago

noografo commented 8 months ago

Hi, as I said in the Wordpress forums, I upgraded from 1.5.0. to 1.5.4. and the plugin doesn't work in the backend. I uninstalled some plugins to see if there was any incompatibility, but I noticed that in a similar website the plugin doesn't show the map and doesn't allow to enter locations either. The solution I've read, and it works, is to downgrade back to 1.5.0.

I hope you find an effective solution. I'm using your plugin on two sites with a lot of data load and it worked perfectly until now. Thank you very much in advance

Translated with www.DeepL.com/Translator (free version)

paragonconsultants commented 8 months ago

Same issue here

mcguffin commented 8 months ago

@paragonconsultants @noografo I found some major issues in acf repeater and flexible content... Is it fixed in the attached zip?

acf-openstreetmap-field.zip

paragonconsultants commented 8 months ago

@paragonconsultants @noografo I found some major issues in acf repeater and flexible content... Is it fixed in the attached zip?

acf-openstreetmap-field.zip

Just tried this but the problem remains

mcguffin commented 8 months ago

@paragonconsultants Okay, then I need some specifics to reproduce it:

... and I'm really afraid to ask, but: Did you clear the Browser cache?

paragonconsultants commented 8 months ago

@paragonconsultants Okay, then I need some specifics to reproduce it:

  • Block or Classic Editor? Maybe on an Options page?
  • Is the map inside an ACF Block, a Repeater, Flexible Content?

... and I'm really afraid to ask, but: Did you clear the Browser cache?

No worries, did clear the cache. Its in the classic editor and looks like the attached image. If the layers button is click top right and then an option is selected the map loads, however on the front of the website the zoom level is ignored and always shows zoomed right out. map

neo-archaic commented 8 months ago

Same issue here, with block editor. The plugin throws the error "Undefined index: layers" in the following file: \wp-content\plugins\acf-openstreetmap-field\include\ACFFieldOpenstreetmap\Field\OpenStreetMap.php

I can fix it by modifying line 602: if ( ! is_array( $value['layers'] ) || ! count( $value['layers'] ) || ! $field['allow_map_layers'] ) {

with if (empty( $value['layers'] ) || ! is_array( $value['layers'] ) || ! count( $value['layers'] ) || ! $field['allow_map_layers'] ) {

Hope this helps to patch it up.

noografo commented 7 months ago

@paragonconsultants Okay, then I need some specifics to reproduce it:

* Block or Classic Editor? Maybe on an Options page?

* Is the map inside an ACF Block, a Repeater, Flexible Content?

... and I'm really afraid to ask, but: Did you clear the Browser cache?

Ok, details: I'm using the field in two custom post types, in two different projects. The cache is disabled. They are not options pages and I don't use blocks. I'm doing it with Oxygen Builder. In one of the CPTs I need more than one marker, but it was impossible, so I thought it would be, as you indicate in the plugin page on wordpress.org, because I chose to use iFrame instead of Leaflet JS. But once you change the return format, the possibility of using the browser disappears and the map disappears. And there's no going back. It happens that in the first project, where there are more than 2000 content entries, t has been working perfectly all these years ago, but from 1.5.0 onwards it's been screwed up. I hope you find the solution, and I take note of what @neo-archaic has done.

neo-archaic commented 7 months ago

@noografo Have you tried the latest update (it's using !isset() instead of empty() )? It's working on my end.

paragonconsultants commented 7 months ago

Any idea when this will be fixed?

neo-archaic commented 7 months ago

It's working for me

dervelli commented 6 months ago

Still not working for me. WP Version 6.4.2 - PHP-Version 8.1.27 - ACF OpenStreetMap Field Version 1.5.6 Also tried the patch from @neo-archaic - no changes tried different browser - no changes tried old 1.5.0 verion - no changes ... :-(

Whats weird: i use the Admin Columns for ACF Fields plugin to display the map in the admin panel - and here it works!! (??)