Skip to content

Commit

Permalink
Update administrator/components/com_fields/src/Model/FieldModel.php
Browse files Browse the repository at this point in the history
Co-authored-by: Harald Leithner <leithner@itronic.at>
  • Loading branch information
bembelimen and HLeithner committed Mar 2, 2024
1 parent e6ac6be commit ecaef31
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions administrator/components/com_fields/src/Model/FieldModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -1113,31 +1113,6 @@ function () use ($component, $section) {

if ($componentInterface instanceof FieldsServiceInterface) {
$componentInterface->prepareForm($form, $data);
} else {
// Try to find the component helper.
$eName = str_replace('com_', '', $component);
$path = Path::clean(JPATH_ADMINISTRATOR . "/components/$component/helpers/fields.php");

if (file_exists($path)) {
$cName = ucfirst($eName) . ucfirst($section) . 'HelperFields';

\JLoader::register($cName, $path);

if (class_exists($cName) && \is_callable([$cName, 'onPrepareForm'])) {
$lang->load($component, JPATH_BASE, null, false, false)
|| $lang->load($component, JPATH_BASE . '/components/' . $component, null, false, false)
|| $lang->load($component, JPATH_BASE, $lang->getDefault(), false, false)
|| $lang->load($component, JPATH_BASE . '/components/' . $component, $lang->getDefault(), false, false);
\call_user_func_array([$cName, 'onPrepareForm'], [&$form]);

// Check for an error.
if ($form instanceof \Exception) {
$this->setError($form->getMessage());

return false;
}
}
}
}

// Trigger the default form events.
Expand Down

0 comments on commit ecaef31

Please sign in to comment.