diff --git a/administrator/components/com_contenthistory/helpers/contenthistory.php b/administrator/components/com_contenthistory/helpers/contenthistory.php index bfbd55a1e0f58..166077b8d2842 100644 --- a/administrator/components/com_contenthistory/helpers/contenthistory.php +++ b/administrator/components/com_contenthistory/helpers/contenthistory.php @@ -121,14 +121,13 @@ public static function getFormValues($object, JTableContenttype $typesTable) { $optionFieldArray = $field->xpath('option[@value="' . $expandedObjectArray[$name] . '"]'); + $valueText = null; + if (is_array($optionFieldArray) && count($optionFieldArray)) - { + { $valueText = trim((string) $optionFieldArray[0]); } - else - { - $valueText = null; - } + $values[(string) $field->attributes()->name] = JText::_($valueText); } }