Skip to content

Commit

Permalink
$field->assigned_cat_ids may not exist. (#13570)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Hunziker authored and wilsonge committed Jan 14, 2017
1 parent 830cda6 commit 7ea9546
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion administrator/components/com_fields/helpers/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ public static function prepareForm($context, JForm $form, $data)
* If the field belongs to an assigned_cat_id but the assigned_cat_ids in the data
* is not known, set the required flag to false on any circumstance.
*/
if (! $assignedCatids && $field->assigned_cat_ids && $form->getField($field->alias))
if (!$assignedCatids && !empty($field->assigned_cat_ids) && $form->getField($field->alias))
{
$form->setFieldAttribute($field->alias, 'required', 'false');
}
Expand Down

0 comments on commit 7ea9546

Please sign in to comment.