Avoid double use of get_lang function with extra fields - refs BT#11015

pull/2487/head
Angel Fernando Quiroz Campos 9 years ago
parent 6084ff7450
commit 2308182a4a
  1. 22
      main/inc/lib/extra_field.lib.php

@ -969,7 +969,7 @@ class ExtraField extends Model
foreach ($field_details['options'] as $option_details) {
$optionList[$option_details['id']] = $option_details;
if ($get_lang_variables) {
$options[$option_details['option_value']] = get_lang($option_details['display_text']);
$options[$option_details['option_value']] = $option_details['display_text'];
} else {
if ($optionsExists) {
// Adding always the default value
@ -1226,16 +1226,6 @@ class ExtraField extends Model
$variable = $field_details['variable'];
$field_id = $field_details['id'];
//Added for correctly translate the extra_field
$get_lang_variables = false;
if (in_array($variable, ['tags'])) {
$get_lang_variables = true;
}
if ($get_lang_variables) {
$field_details['display_text'] = get_lang($field_details['display_text']);
}
$tagsSelect = $form->addSelect(
"extra_{$field_details['variable']}",
$field_details['display_text']
@ -1531,16 +1521,6 @@ EOF;
}
break;
case ExtraField::FIELD_TYPE_VIDEO_URL:
//Added for correctly translate the extra_field
$get_lang_variables = false;
if (in_array($field_details['variable'], ['video_url'])) {
$get_lang_variables = true;
}
if ($get_lang_variables) {
$field_details['display_text'] = get_lang($field_details['display_text']);
}
$form->addUrl(
"extra_{$field_details['variable']}",
$field_details['display_text'],

Loading…
Cancel
Save