Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in FO translations with multiple resources and tpl inclusions #14507

Merged
merged 2 commits into from Jul 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion config/smartyfront.config.inc.php
Expand Up @@ -217,7 +217,14 @@ function smartyTranslate($params, $smarty)
}

$string = str_replace('\'', '\\\'', $params['s']);
$basename = basename($smarty->source->name, '.tpl');

// fix inheritance template filename in case of includes from different cross sources between theme, modules, ...
$filename = $smarty->template_resource;
if (!isset($smarty->inheritance->sourceStack[0]) || $filename === $smarty->inheritance->sourceStack[0]->resource) {
$filename = $smarty->source->name;
}

$basename = basename($filename, '.tpl');
$key = $basename.'_'.md5($string);

if (isset($smarty->source) && (strpos($smarty->source->filepath, DIRECTORY_SEPARATOR.'override'.DIRECTORY_SEPARATOR) !== false)) {
Expand Down