Skip to content

Commit

Permalink
Coping with possible missing stings in the Options
Browse files Browse the repository at this point in the history
  • Loading branch information
infograf768 committed Oct 31, 2014
1 parent 63efbc2 commit e4782e9
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions libraries/cms/form/field/contenttype.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,18 @@ protected function getOptions()
$lang->load($comp . '.sys', JPATH_ADMINISTRATOR, null, false, true)
|| $lang->load($comp . '.sys', JPATH_ADMINISTRATOR . '/components/' . $comp, null, false, true);

$option->text = mb_strtoupper(str_replace(' ', '_', $option->text), 'UTF-8');
$option->text = $comp . '_CONTENT_TYPE_' . $option->text;
$option->text = JText::_($option->text);
$option->string = mb_strtoupper(str_replace(' ', '_', $option->text), 'UTF-8');
$option->string = $comp . '_CONTENT_TYPE_' . $option->string;

if ($lang->hasKey($option->string))
{
$option->text = JText::_($option->string);
}
else
{
$option->text = $option->text;
}

}

return $options;
Expand Down

0 comments on commit e4782e9

Please sign in to comment.