PR-5.2-dev Pending

User tests: Successful: Unsuccessful:

avatar Sanjana2906
Sanjana2906
5 Apr 2025

Pull Request for Issue #45151

Summary of Changes
This PR fixes the wrong autoload path for fields when the "administrator" folder has been redefined. The current setup assumes the folder is in the default location, and makes sure Joomla will always find the right location for "administrator" folder, no matter where it's placed.

Testing Instructions

  1. Set up a custom "administrator" folder
    Move or rename "administrator " folder in your Joomla installation to simulate custom folder.

  2. Check the issue before applying the fix
    Access a page in Joomla admin panel that requires autoload fields. It should fail to load the fields correctly due to the custom folder location.

3.Apply the PR
Merge the PR into Joomla installation

  1. Check the fix after applying the PR
    Reload the same page. The fields should now load correctly, even with the custom folder location.

Actual result BEFORE applying this Pull Request
Joomla cannot find the autoload path for the fields, even when the "administrator" folder is relocated or renamed, and the fields will be loaded with errors.

Expected result AFTER applying this Pull Request
Joomla will correctly find the autoload path for the fields, even when the "administrator" folder is relocted or renamed and the fields will be loaded without any errors.

avatar Sanjana2906 Sanjana2906 - open - 5 Apr 2025
avatar Sanjana2906 Sanjana2906 - change - 5 Apr 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 Apr 2025
Category Administration com_fields Repository
avatar fgsw
fgsw - comment - 5 Apr 2025

@Sanjana2906 Please change the title from

"Fix for issue #45151 -"
to
"[5.2]"

Titles are used in the changelog. Havin the issue number in the title isn't needed as the number is shown in the comment.

avatar Sanjana2906 Sanjana2906 - change - 5 Apr 2025
Title
Fix for issue #45151 - Fixed wrong autoload fields path for redefined administrator
[5.2] - Fixed wrong autoload fields path for redefined administrator
avatar Sanjana2906 Sanjana2906 - edited - 5 Apr 2025
avatar Sanjana2906 Sanjana2906 - change - 5 Apr 2025
Labels Added: PR-5.2-dev
avatar joomla-cms-bot joomla-cms-bot - change - 5 Apr 2025
Category Administration com_fields Repository Administration com_fields com_languages Repository Installation Libraries
avatar Hackwar
Hackwar - comment - 5 Apr 2025

It seems that you have additional changes in this PR which are unrelated to the change you want to do. Can you please fix that?

avatar brianteeman
brianteeman - comment - 5 Apr 2025

As stated before this alone will not work

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

You might make fields work but you still will not be able to do many things

  • update joomla
  • use cache
  • use logs
  • manage templates

If what you are aiming to do is to move joomla out of the public web space then we already provide the means to do that

avatar Sanjana2906
Sanjana2906 - comment - 6 Apr 2025

Thanks for the feedback!
@Hackwar I had some unrelated changes included earlier. I've now cleaned those up so that the PR only contains the fix FieldsHelper.php.

avatar Sanjana2906
Sanjana2906 - comment - 6 Apr 2025

Thanks for the feedback!
@brianteeman I realize that the administrator folder isn't fully supported and would require much broader changes. I will try to resolve the issue.

avatar exlemor
exlemor - comment - 6 Apr 2025

Thanks for the feedback! @brianteeman I realize that the administrator folder isn't fully supported and would require much broader changes. I will try to resolve the issue.

Hi @Sanjana2906,

I am by far not an expert in coding but since there have been some concerns raised about whether this solution (and even the issue) is beneficial to be included into Joomla, could you share your perspective on the topic vs trying to fix something that may not be (100%) fixable?

Sometimes, an issue raised is just not a good idea to be developed.

From my (limited) understanding of how everything fits into the Joomla structure, this feels like a fix that will create many more problems than it solves - especially considering the very limited security benefit brought by being able to rename the /administrator path... due to the concerns raised, I'd imagine there is a (pretty good) chance that the maintainers will not include this into the codebase when there are many other issues/PR that you could work on that would be (very) beneficial to the project.

avatar Sanjana2906
Sanjana2906 - comment - 6 Apr 2025

Hi @exlemor
Thank you for sharing your thoughts.
I now understand that changing the administrator folder path isn't officially supported and could lead to broader issues across the system. My intent with this PR was to address a very specific edge case related to autoload path for fields when such a redefinition is attempted , rather than to support renaming the entire administrator directory as a general feature.
I agree that if the overall benefit is limited and the risk of breaking areas is high, it may not be suitable for inclusion. I'm happy to pause this effort and shift my focus to other open issues that would be more impactful for the project.

avatar exlemor exlemor - change - 11 Apr 2025
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2025-04-11 01:25:20
Closed_By exlemor
avatar exlemor exlemor - close - 11 Apr 2025

Add a Comment

Login with GitHub to post a comment