Greetings.

I have discovered the following issue: when I created helptip node (english version) for en/user/login and french version for fr/user/login id doesn't work because helptip module thinks the current url is user/login in both cases and LIKE doesn't work correctly.

I propose the following upgrade to integrate your module with i18n.module:

function _helptip_get_current_paths() {
  $locale = locale_initialize();
  $path = (module_exists('i18n') && $locale ? "$locale/" : ''). $_GET['q'];
  $paths = array(db_escape_string($path));
  if ($alias = drupal_lookup_path('alias', $_GET['q']))
    $paths[] = db_escape_string($alias);
  return $paths;
}

Your thoughts? Thanks.

Comments

ardas’s picture

A little bit better version:

function _helptip_get_current_paths() {
  if (module_exists('i18n')) {
    $locale = locale_initialize();
    $path = "$locale/". $_GET['q'];
  } else {
    $path = $_GET['q'];
  }
  $paths = array(db_escape_string($path));
  if ($alias = drupal_lookup_path('alias', $_GET['q']))
    $paths[] = db_escape_string($alias);
  return $paths;
}