After upgrading, the hover markers in my gmap views have changed from a simple Title, with no link (even though link from title is selected in view settings) to something that displays the html for a link, the name and also replaces special characters with ASCII codes.

What once showed "HIRAM's PLACE" on hover now shows HIRAM'S PLACE when hovered over the icon on the gmap for that location.

CommentFileSizeAuthor
#2 gmap1.png51.18 KBJSCSJSCS
#2 gmap2.png30.23 KBJSCSJSCS

Comments

JSCSJSCS’s picture

I did a bisect and found that commit f1203055ca084364f0f3d7050cbb9a6f818b0725 introduced the issue.

The previous commit daed68af5995775decc0340d35d9458590c11fd6 works as 7.x-1.x did with regard to displaying the marker text from the title field.

I should also point out that the odd tooltip behavior only exhibits itself when there are several locations displayed on the map. If a single location is displayed, then the tooltip looks correct.

JSCSJSCS’s picture

StatusFileSize
new30.23 KB
new51.18 KB

Images showing tooltips with many locations and a single location.

errors in tooltip

no error in tooltip

Bagz’s picture

This issue is caused by the tooltip being built from the rendered field content (see for example views_plugin_style.inc, ~ line 525), which is then used in gmap_plugin_style_gmap.inc ~ line 233.

HTML tooltips are html attributes, not rendered content, hence the problem here.

My way of getting around this was to add the line
$tooltip = htmlspecialchars_decode($tooltip, ENT_QUOTES);
immediately following the line in gmap_plugin_style_gmap.inc, which reverts the special characters back to what they were.

ikeigenwijs’s picture

Issue summary: View changes
Status: Active » Needs review

tried this but did not help
line 259 in gmap_plugin_style_gmap.inc
if ($this->options['tooltipenabled'] && !empty($this->rendered_fields[$row_index][$this->options['tooltipfield']])) {
$tooltip = $this->rendered_fields[$row_index][$this->options['tooltipfield']];
$tooltip = htmlspecialchars_decode($tooltip, ENT_QUOTES);

ikeigenwijs’s picture

Status: Needs review » Active

cannot change the Status in edit

wildlife’s picture

I'm having the same problem. GMap version 7.x-2.9.

wildlife’s picture

I just tried the solution in #3 and it worked. Starting at line 254 in version 7.x.-2.9, I now have the following code:

$tooltip = "";
          if ($this->options['tooltipenabled'] && !empty($tooltip_field) && !empty($row->{$tooltip_field})) {
            $tooltip = $row->{$tooltip_field};
          $tooltip = htmlspecialchars_decode($tooltip, ENT_QUOTES);
          }

I don't know if the way I added the new line is correct though. Please advise if this is how it should be. It worked though. Thanks.

summit’s picture

Hi,

May be late. But this works

if (!empty($marker->title)) {
    $marker->title = check_plain($marker->title);
  }

See for D7, https://www.drupal.org/node/2615890
greetings, Martijn