Closed (cannot reproduce)
Project:
Transliteration
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Sep 2010 at 22:40 UTC
Updated:
30 Sep 2011 at 08:05 UTC
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
Comment #1
smk-ka commented$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.
Comment #2
csavio commentedI 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.
Comment #3
hakanyanaz commentedWhen 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).
Comment #4
amateescu commentedCan you please try the latest -dev version? I cannot reproduce this with 7.x-3.x-dev.