If one chooses a entity translatable field as field for tooltip
then tooltip appears with NID

on the other hand on the newest dev version the bubble text on similar situation displays the appropriatte translation of the field

Files: 
CommentFileSizeAuthor
#8 gmap_1326176_8_tooltip_field.patch1.62 KBjohnv
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch gmap_1326176_8_tooltip_field.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#7 gmap_1326176_6_tooltip_field.patch1.34 KBjohnv
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch gmap_1326176_6_tooltip_field.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#6 gmap_1326176_1_tooltip_field.patch1.72 KBjohnv
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch gmap_1326176_1_tooltip_field.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#1 gmap_tooltip_display_with_translatable_field.1326176_1.patch1.39 KBGiorgosK
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in gmap_tooltip_display_with_translatable_field.1326176_1.patch.
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new1.39 KB
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in gmap_tooltip_display_with_translatable_field.1326176_1.patch.
[ View ]

the problem with the code is field_alias always gets the NID as described by merlinofchaos in #5 #1160706: Views 3 and $row->{$view->field['field_id']->field_alias}

      $tooltip_field = $tooltip_field_obj->field_alias;

I created a patch using borrowed code from the bubble text since it behaves correctly

I have tested and it works correctly

PS
other possible solutions would involve extracting one of the following variables (+ additional code down the function call

      $tooltip_field = $tooltip_field_obj->field;
      $tooltip_field = $tooltip_field_obj->real_field;
      $tooltip_field = $tooltip_field_obj->field_info['field_name'];
      $tooltip_field = $tooltip_field_obj->table;

I would call strip_tags() on tooltip as it can not display html tags.

<?php
// Remove all HTML and PHP tags from a tooltip. For best performance, we act only
// if a quick strpos() pre-check gave a suspicion (because strip_tags() is expensive).
 
if (strpos($tooltip, '<') !== FALSE) {
   
$tooltip = strip_tags($tooltip);
  }
?>

note: the "Rewrite results" views functionality (for the tooltip) does not work without this patch..

Version:7.x-1.x-dev» 7.x-2.x-dev
Status:Needs review» Needs work

#1

git apply --check gmap_tooltip_display_with_translatable_field.1326176_1.patch
error: patch failed: gmap_plugin_style_gmap.inc:102
error: gmap_plugin_style_gmap.inc: patch does not apply

this needs rerol against latest dev

Status:Needs work» Needs review
StatusFileSize
new1.72 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch gmap_1326176_1_tooltip_field.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

IMO this is about all Entity fields.

Please find a new patch, containing #1 and #3. It is against latest 7.x-1.x.
The strip_tags() removes all newlines, too. That can be better.

StatusFileSize
new1.34 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch gmap_1326176_6_tooltip_field.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

OTOH, strip_tagging can already be done by the default Views field rewrite option.
Attached patch is rerolling #1.

StatusFileSize
new1.62 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch gmap_1326176_8_tooltip_field.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

And, ofcourse, enabling fields should leave the 'properties' (title, author) unharmed.

Status:Needs review» Fixed

#8 thanks!

commited pushed to 7.x-2.x-dev
backported to 7.x-1.x-dev

Status:Fixed» Closed (fixed)

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