In the _transliteration_replace function from 6.x-3.0 it looks like the $base variable is undefined. I'm getting question marks or unknown for any text that needs to be transliterated now. Menu item classes in my case. I stepped through the function and anything that needs transliteration has an issue at line 197 of transliteration.inc where it maps to $base. I do not see where that variable is declared.

function _transliteration_replace($ord, $unknown = '?', $langcode = NULL) {
  static $map = array();

  if (!isset($langcode)) {
    global $language;
    $langcode = $language->language;
  }

  $bank = $ord >> 8;

  if (!isset($map[$bank][$langcode])) {
    $file = drupal_get_path('module', 'transliteration') . '/data/' . sprintf('x%02x', $bank) . '.php';
    if (file_exists($file)) {
      include $file;
      if ($langcode != 'en' && isset($variant[$langcode])) {
        // Merge in language specific mappings.
        $map[$bank][$langcode] = $variant[$langcode] + $base;
      }
      else {
        $map[$bank][$langcode] = $base;
      }
    }
    else {
      $map[$bank][$langcode] = array();
    }
  }

  $ord = $ord & 255;

  return isset($map[$bank][$langcode][$ord]) ? $map[$bank][$langcode][$ord] : $unknown;
}

Comments

smk-ka’s picture

$base and $variant are the base and language-specific replacement matrices and are declared in the included file. Are you running some sort of PHP opcode cache? If so, clear the cache (restart server) because the format of the data files changed.

csavio’s picture

Status: Active » Closed (fixed)

I see, that looks like the issue. It looks like someone didn't update the data files on the environment I was looking at. I'll get the correct files published and that should resolve the issue. Thanks, and sorry about that.

hakanyanaz’s picture

Version: 6.x-3.0 » 7.x-3.0-alpha1
Status: Closed (fixed) » Active

When I edit a node, the error occured and can not been any changes in the URLs.
All caches cleared but I use dreamhost, so can not restart server.

Is there any solution for this issue?

Thank you.

Notice: Undefined variable: base in _transliteration_replace() (line 197 of /home/xxxx/sites/all/modules/transliteration/transliteration.inc).
Notice: Undefined variable: base in _transliteration_replace() (line 197 of /home/xxxx/sites/all/modules/transliteration/transliteration.inc).

amateescu’s picture

Version: 7.x-3.0-alpha1 » 7.x-3.x-dev
Status: Active » Closed (cannot reproduce)

Can you please try the latest -dev version? I cannot reproduce this with 7.x-3.x-dev.