Skip to content

Wrong autoload fields path for redefined administrator folder #45151

@pinta83

Description

@pinta83

Steps to reproduce the issue

Change "administrator" folder in "/includes/defines.php" and "/administrator/includes/defines.php" to "admin"
rename "administrator" folder to "admin"

Expected result

Everything working

Actual result

Fields not getting loaded due to wrong path

System information (as much as possible)

Joomla 5.x

Additional comments

Fix paths in the "prepareForm" function in administrator/components/com_fields/src/Helper/FieldsHelper.php lines 430 and 431.

CURRENT CODE

$fieldset->setAttribute('addfieldpath', '/administrator/components/' . $component . '/models/fields');
$fieldset->setAttribute('addrulepath', '/administrator/components/' . $component . '/models/rules');

PROPOSED FIX

$fieldset->setAttribute('addfieldpath', str_replace(JPATH_ROOT, '', JPATH_ADMINISTRATOR) . '/components/' . $component . '/models/fields');
$fieldset->setAttribute('addrulepath', str_replace(JPATH_ROOT, '', JPATH_ADMINISTRATOR) . '/components/' . $component . '/models/rules');

Related

Related to issue #44980

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions