After updating the gmap module I have noticed an issue with the error "Request for invalid marker set 'name'" while loading my maps. After investigating I noticed that the variable('gmap_marker_custom_dir') was missing and is no longer being used for anything useful other than populating the titles of Markers within certain drop downs and NOT the more important part of supplying the JSON necessary to load these markers into the map.

I've made a temporary fix by adding a custom gmap_marker_info_alter hook to my module but I believe problem lies in the file gmap_markerinfo.info within the gmap_gmap_markerfiles_info() function. This is likely the best place for the gmap_marker_custom_dir variable to be used but it's not. It's essentially useless.

I did a diff of the update and I notice that the variable WAS being used in the _gmap_get_icondata() function originally but it seems they moved a bit of that functionality out of there and moved into this new gmap_gmap_markerfiles_info BUT they removed the part where the custom dir is scanned for ini files. I do not understand the reasoning behind that.

CommentFileSizeAuthor
#2 custom-marker-dir-2692971.patch546 bytesedward.radau

Comments

edward.radau created an issue. See original summary.

edward.radau’s picture

StatusFileSize
new546 bytes

Adding patch which should fix this.

edward.radau’s picture

Status: Active » Needs review
edward.radau’s picture

Forgot to bring this up in the original issue description, but in the .install file there is a gmap_update_7202 which is deleting this variable with a comment suggesting that it's no longer in use. However in the gmap configuration page that field is still being rendered giving a false impression that it indeed is being used as well as the reference to it within the _gmap_get_marker_titles() function. It almost feels like there was a plan to completely scrap the variable but it doesn't appear complete.

carsteng’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm this behavior. #2 worked for me!

hwasem’s picture

Wow, this was a huge issue for us and #2 fixes it. Thank you so much!

bjcooper’s picture

I also confirm this behavior, which was a huge issue for us as well (focus-grabbing JS alerts and non-functional maps everywhere). The patch in #2 fixes it.

benjamin_dk’s picture

I encountered this issue as well after updating to v. 7.x-2.11 and yeah, it was really confusing that the path in the custom markers field was not being used all of a sudden.

Since I have the Libraries module installed I chose to move my custom gmap-marker folder to sites/libraries/gmap_markers and it is now being registered automatically in gmap_markerinfo.inc by the code

  if (module_exists('libraries')) {
    $markercustomdir = libraries_get_path('gmap_markers');
    if ($markercustomdir) {
      $markerdirs[] = $markercustomdir;
    }
  }

A useful strategy if you don't want to patch the module and have the Libraries module on your site.

NewZeal’s picture

I can confirm this patch works for me, too. Looking forward to it being committed to the module. Thanks.

phily’s picture

Patch in comment #2 works, thanks.

EDIT: as per comment #8, putting gmap_markers folder in sites/all/libraries is far more efficient than patching.

Gremlet’s picture

Heya,
I updated patch #2 for code in gmap_markerinfo.inc to appear as:

* We just scan the directory set in the the 'gmap_markerfiles' variable.
 */
function gmap_gmap_markerfiles_info() {
  $markerdirs = variable_get('gmap_markerfiles', array(drupal_get_path('module', 'gmap') . '/markers'));
   $markercustomdir = variable_get('gmap_marker_custom_dir', NULL);
    if ($markercustomdir) {
     $markerdirs[] = $markercustomdir;
    }

  if (module_exists('libraries')) {

I then refreshed cache all, and regenerated map markers.
The markders are still absent.

Any suggestions as to what else I may to do, or did wrong to resurrect the customer markers please?

edward.radau’s picture

Gremlet, that looks relatively the same to me besides some minor formatting differences. For that, I would double-check that you have a path as defined in the gmap_marker_custom_dir variable at admin/config/services/gmap which is basically the Custom markers path at the very bottom. And to also make sure that the path you specified has a valid .ini file and images which this .ini file will specify as individual markers.

Another potential issue would be permissions issue regarding your gmap_markers.js which is generated and most likely placed in sites/default/files/js. If not I would check through your watchdog log to look for any other potential causes.

stlnyc’s picture

Has anyone running 7.x-2.11 been able to get custom markers to display on a map? We had custom markers working fine running 7.x-2.9, but after updating we cannot get our custom marker images to load (only seeing default fallback markers).

We have placed the INI file and referenced marker PNG images at: sites/libraries/gmap_markers...and we can access the sites/default/files/js/gmap_markers.js file no problem...we've also regenerated markers and cleared caches (both Drupal and local).

Still no luck...any further ideas? Thanks everyone in advance.

stlnyc’s picture

Following up on my comment above, we were able to get our custom markers to display with this patch (https://www.drupal.org/node/2698109) -- just an FYI to others who may be experiencing issues getting marker images to display using a custom marker field.

crutch’s picture

under performance, not aggregating js files fixed the issue for us - on 2.9yes works for 2.11 thanks

Anonymous’s picture

Patch #2 fixes the problem for me. Thanks a lot.

BarisW’s picture

Priority: Major » Critical
Issue tags: -markers custom directory gmap

I've spend hours debugging this issue. Please commit the patch in #2.

Bumping this to critical since 7.x-2.11 breaks all sites with custom markers.

phily’s picture

As per comment #8, putting gmap_markers folder in sites/all/libraries makes patch useless.
Maybe the documentation should be more precise on that point.

kentr’s picture

The patch isn't useless, because the broken custom markers setting still exists.

If the setting isn't going to be restored, it should be removed so that people don't keep hitting the problem...

Gremlet’s picture

I had to revert the site as I couldn't getting the custom icons working and afford the site to be in downtime.
Looking forward to seeing this fab module updated and hearing back from the community the custom_icons are working as expected.

vkechagias’s picture

The following has worked for me:

1. Keep note of your current "Custom markers path" setting in the gmap settings page
2. Replace the gmap module folder with the 7.x-2.11 version
3. Patch the corresponding file with the patch of this thread
4. Run db updates (update.php or drush updatedb)
5. Navigate to the gmap settings, re-enter your Custom markers path and save
6. Regenerate markers
7. Clear Drupal cache

As mentioned in #4 during the update the Custom markers path variable is getting deleted. The issue that caused this seems to be https://www.drupal.org/node/667272 which currently has the status "Needs work".

I believe the current patch should be used as a workaround and the issue should be correctly solved in the inital issue https://www.drupal.org/node/667272

jsst’s picture

Why don't we remove the offending variable_del from the update and release a 2.12 version with this patch included? That way people have an update path from 2.10 to 2.12 without running into issues with a custom marker dir.

  • podarok committed a609065 on 3.0.x
    Issue #2692971 by edward.radau: Custom markers dir appears useless after...
podarok’s picture

Version: 7.x-2.11 » 3.0.x-dev
Status: Reviewed & tested by the community » Fixed

#2 is in
tnx

  • podarok committed a609065 on 7.x-2.x
    Issue #2692971 by edward.radau: Custom markers dir appears useless after...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.