No Code Attached Yet
avatar pinta83
pinta83
18 Mar 2025

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

avatar pinta83 pinta83 - open - 18 Mar 2025
avatar joomla-cms-bot joomla-cms-bot - change - 18 Mar 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 18 Mar 2025
avatar pinta83 pinta83 - change - 18 Mar 2025
The description was changed
avatar pinta83 pinta83 - edited - 18 Mar 2025
avatar pinta83 pinta83 - change - 18 Mar 2025
The description was changed
avatar pinta83 pinta83 - edited - 18 Mar 2025
avatar pinta83 pinta83 - change - 18 Mar 2025
The description was changed
avatar pinta83 pinta83 - edited - 18 Mar 2025
avatar brianteeman
brianteeman - comment - 18 Mar 2025

there are lots of places where the code will be broken by changing the name of the admin folder. to the best of my knowledge it has never been supported for the administrator folder to be renamed

avatar pinta83
pinta83 - comment - 18 Mar 2025

As for the Joomle core, this should be it. I'm using it with changed administrator folder - and this is 2 out 2 that is making problems. The other bug i reported is fixed.

The folder is in defines.php as are all other path constants - so I wouldn't agree that it has never been supported.
Joomla 3 did a good job with no problem, this bugs were introduced with J4.

avatar brianteeman
brianteeman - comment - 18 Mar 2025

As for the Joomle core, this should be it. I'm using it with changed administrator folder - and this is 2 out 2 that is making problems. The other bug i reported is fixed.

check the code - i can assure you that there are many other areas

avatar joomdonation
joomdonation - comment - 21 Mar 2025

@pinta83 Since you have solution, could you please make a PR with the proposed changes ?

avatar chmst
chmst - comment - 1 Apr 2025

@pinta83 Thank you for working on that. Could you please make your PR as a PR on Joomla, the branch 5.3-dev?

avatar exlemor exlemor - change - 11 Apr 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-04-11 01:27:30
Closed_By exlemor
avatar exlemor exlemor - close - 11 Apr 2025

Add a Comment

Login with GitHub to post a comment