Skip to content
13 changes: 6 additions & 7 deletions administrator/components/com_fields/src/Model/GroupModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,18 +240,17 @@ protected function preprocessForm(Form $form, $data, $group = 'content')

$parts = FieldsHelper::extract($this->state->get('filter.context'));

// Extract the component name
$component = $parts[0];
//$parts is null if there are not two parts
if ($parts) {
// Extract the component name
$component = $parts[0];

// Extract the optional section name
$section = (count($parts) > 1) ? $parts[1] : null;
// Extract the section name
$section = $parts[1];

if ($parts) {
// Set the access control rules field component value.
$form->setFieldAttribute('rules', 'component', $component);
}

if ($section !== null) {
// Looking first in the component models/forms folder
$path = Path::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/models/forms/fieldgroup/' . $section . '.xml');

Expand Down