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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

GiorgosK’s picture

Status: Active » Needs review
FileSize
1.39 KB

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;
GiorgosK’s picture

Pasqualle’s picture

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

// 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);
  }
Pasqualle’s picture

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

podarok’s picture

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

johnv’s picture

Status: Needs work » Needs review
FileSize
1.72 KB

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.

johnv’s picture

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

johnv’s picture

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

podarok’s picture

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.