Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion administrator/components/com_fields/forms/field.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
label="COM_FIELDS_FIELD_ONLY_USE_IN_SUBFORM_LABEL"
layout="joomla.form.field.radio.switcher"
default="0"
showon="type!:subform"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ protected function getOptions()

// Iterate over the custom fields for this context
foreach (static::$customFieldsCache[$this->context] as $customField) {
// Skip our own subform type. We won't have subform in subform.
if ($customField->type == 'subform') {
continue;
}

$options[] = HTMLHelper::_(
'select.option',
$customField->id,
Expand Down
12 changes: 2 additions & 10 deletions administrator/components/com_fields/src/Model/FieldModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -580,17 +580,9 @@ public function getForm($data = [], $loadData = true)
$form->setFieldAttribute('created_user_id', 'filter', 'unset');
}

// In case we are editing a field, field type cannot be changed, so some extra handling below is needed
// In case we are editing a field, field type cannot be changed, so remove showon attribute to avoid js errors
if ($fieldId) {
$fieldType = $form->getField('type');

if ($fieldType->value == 'subform') {
// Only Use In subform should not be available for subform field type, so we remove it
$form->removeField('only_use_in_subform');
} else {
// Field type could not be changed, so remove showon attribute to avoid js errors
$form->setFieldAttribute('only_use_in_subform', 'showon', '');
}
$form->setFieldAttribute('only_use_in_subform', 'showon', '');
}

return $form;
Expand Down