diff --git a/administrator/components/com_fields/helpers/fields.php b/administrator/components/com_fields/helpers/fields.php index 1e92e0da66d02..8bc6a6dd0acfa 100644 --- a/administrator/components/com_fields/helpers/fields.php +++ b/administrator/components/com_fields/helpers/fields.php @@ -219,11 +219,11 @@ public static function prepareForm ($context, JForm $form, $data) $assignedCatids = isset($data->catid) ? $data->catid : (isset($data->fieldscatid) ? $data->fieldscatid : null); - if (! $assignedCatids && $form->getField('assigned_cat_ids')) + if (! $assignedCatids && $form->getField('catid')) { // Choose the first category available $xml = new DOMDocument; - $xml->loadHTML($form->getField('assigned_cat_ids')->__get('input')); + $xml->loadHTML($form->getField('catid')->__get('input')); $options = $xml->getElementsByTagName('option'); if ($firstChoice = $options->item(0))