Skip to content

[6.2] Prevent root copy failure in FileAdapter and improve fileset check - #48121

Open
LadySolveig wants to merge 5 commits into
joomla:6.2-devfrom
LadySolveig:6.2/fix/installer-fileadapter
Open

LadySolveig wants to merge 5 commits into
joomla:6.2-devfrom
LadySolveig:6.2/fix/installer-fileadapter

Conversation

@LadySolveig

@LadySolveig LadySolveig commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request resolves # .

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

This pull request introduces a safeguard to the file installation process in the FileAdapter installer, preventing accidental copying of all files from a package root to the site root.
It also fixes an error if no fileset is available in manifest file (for example, if everything is handled separately via an installer script).

Testing Instructions

Case 1 - no fileset in manifest file - only installer script

fileadaptertest2.zip

Case 2 - various configurations within the fileset using the folder and target attributes

fileadaptertest.zip

Actual result BEFORE applying this Pull Request

Case 1

Unfortunately, this error message occurs only sporadically and cannot always be reproduced.
However, the PHP error can be traced at this point.FileAdapter.php#L505

error

Case 2

These files can be found in the root of the site:

fileadaptertest.php
fileadaptertest.xml
i_should_not_be_in_root.txt
LICENSE
README.md

Expected result AFTER applying this Pull Request

Case 1

No 'JSON.parse: unexpected character at line 1 column 1 of the JSON data' - error message.

image

If you visit the frontend using the standard Cassiopeia template, you should see this message
image

Or alternatively, this comment in the index.php in the cassiopeia template code - line 13.

defined('_JEXEC') or die;

// I should be here to ensure fileadaptertest script is working correctly.

Case 2

image

You should see the same for the template index.php override in Cassiopeia template like in case 1.

  1. All files from a specific file package folder can be copied into any folder in Joomla.
<files folder="test" target="fatest1"></files>
  • New folder fatest1with the following file
    • i_should_be_here.txt
  1. All files from a specific file package folder can be deliberately copied into Joomla root.
<files folder="test"></files>

New file under root on the site i_should_be_here.txt

  1. All root files from the file package can still be deliberately copied into any folder (except the root) in Joomla.
<files target="fatest2"></files>
  • New folder fatest2 with the following files
    • fileadaptertest.php
    • fileadaptertest.xml
    • i_should_not_be_in_root.txt
    • LICENSE
    • README.md
  1. A specific file can still be copied to the root of the Joomla site.
 <files>test/i_should_be_here.txt</files>

New file under root on the site i_should_be_here.txt

  1. Preventing accidental copying of all files from a package root to the site root.
<files></files>

You should see this warning message

image

These files should not be copied to the root of the site:

  • fileadaptertest.php
  • fileadaptertest.xml
  • i_should_not_be_in_root.txt
  • LICENSE
  • README.md

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-6.2-dev labels Jul 19, 2026
@LadySolveig
LadySolveig marked this pull request as ready for review July 19, 2026 18:15
@ThomasFinnern

ThomasFinnern commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 83c1019

Tested on 5.4.8-dev Works as expected
Found different message on test case 1 without patch applied
image


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48121.

@LadySolveig LadySolveig added PBF Pizza, Bugs and Fun and removed PBF Pizza, Bugs and Fun labels Aug 21, 2026
@beni71

beni71 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 3811bfd

I tested with current Joomla 6.2.0 and Patch Tester installed.

To test everything I had to update both prepared zip-files to not get this warning "File patcher skipped. Unsupported Joomla version detected: 6.2.0. Supported versions: 5.4.9-dev, 6.1.4-dev, 6.2.0-beta2-dev.". I changed in both zip-files fileadaptertest.php the supported versions to:
private array $supportedVersions = array('5.4.9-dev', '6.1.4-dev', '6.2.0');


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48121.

@LadySolveig

Copy link
Copy Markdown
Contributor Author

Thank you for testing @beni71

Yes, I wasn’t sure if or when the fix would become relevant again, so at some point I stopped updating the plugins, thinking that if anyone wanted to test it, they’d surely let me know and I’d sort it out at short notice. All the better that you managed just fine as it was. Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language Change This is for Translators PR-6.2-dev

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants