backdrop-contrib / ip_geoloc

IP Geolocation Views & Maps for Backdrop CMS.
GNU General Public License v2.0
0 stars 2 forks source link

Views location differentiator and associated markers not saved #8

Open pgrayove-mcpl opened 1 year ago

pgrayove-mcpl commented 1 year ago

In the views format Map (Google API, via IPGV&M) settings, the location differentiator marker settings will not save. You can see and select markers that are in the marker directory, but the settings do not save and only the default marker displays on the map.

This notice displays when selecting a location differentiator: Notice: Array to string conversion in backdrop_attributes() (line 2835 of /app/core/includes/common.inc).

AlexHoebart-ICPDR commented 6 months ago

I'm using Leaflet, not Google Maps, but I think the problem and fix could be the same. See PR at https://github.com/backdrop-contrib/ip_geoloc/pull/9

AlexHoebart-ICPDR commented 2 weeks ago

I noticed that the previous fix only addresses simple cases, there are two more cases when location differentiator and associated markers are not saved:

  1. When the differentiator field drop-down is changed: in this case the $form_state['differentiator'] still has the old value and saving values for the newly selected differentiator fails - must be something related to different way of form handling in Backdrop.
  2. There seem to be differences in Backdrop how to identify Taxonomy reference fields and how default values for fields have to be provided, so these fields did not work in the settings form and therefore were also not saved correctly. I updated this, not sure if it covers all cases but it worked for me now with core taxonomy and list fields.

I will provide a PR.