Skip to content

[5.2] Fix fixFilesystemPermissions method in script.php for not existing folder#44483

Merged
Hackwar merged 1 commit intojoomla:5.2-devfrom
richard67:5.2-dev-fix-filesystem-fix-folder-not-exists
Nov 19, 2024
Merged

[5.2] Fix fixFilesystemPermissions method in script.php for not existing folder#44483
Hackwar merged 1 commit intojoomla:5.2-devfrom
richard67:5.2-dev-fix-filesystem-fix-folder-not-exists

Conversation

@richard67
Copy link
Member

@richard67 richard67 commented Nov 19, 2024

Pull Request for Issue #44482 .

Summary of Changes

This pull request (PR) fixes an error in the "fixFilesystemPermissions" method which was added to script.php with my PR #44379 for fixing files and folder permissions when updating from 5.2.0 or 5.2.1.

When you have a 5.2.0 or 5.2.1 site with a long update history, it might be that e.g. the "images/sampledata/cassiopeia" folder is missing because we do not include the sample data images in our update packages.

It can also be that an administrator has deleted that folder in the media manager, which is also a valid use case.

In this case the "fixFilesystemPermissions" method causes an exception because it tries to get the list of files for a not existing folder.

This PR fixes that.

Testing Instructions

On a 5.2.0 or 5.2.1 site, delete the folder "images/sampledata/cassiopeia" (or rename it if you want to restore it later).

Then switch on "Debug System" in global configuration and set "Error Reporting" to "Maximum".

Then update to either 5.2.2-rc1 or a current 5.3-dev nightly build to get the actual result.

Or with the same starting conditions, update to the patched package https://artifacts.joomla.org/drone/joomla/joomla-cms/5.2-dev/44483/downloads/80427/Joomla_5.2.2-rc1+pr.44483-Release_Candidate-Update_Package.zip or custom update URL https://artifacts.joomla.org/drone/joomla/joomla-cms/5.2-dev/44483/downloads/80427/pr_list.xml created by Drone for this PR to get the expected result.

Actual result BEFORE applying this Pull Request

See issue #44482 .

Expected result AFTER applying this Pull Request

Update succeeds.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@dautrich
Copy link

I have tested this item 🔴 unsuccessfully on 05467d0


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

@dautrich
Copy link

dautrich commented Nov 19, 2024

Tested using the patch tester.

grafik

grafik

@richard67
Copy link
Member Author

richard67 commented Nov 19, 2024

@dautrich Please follow exactly my testing instructions. It does not matter if the patch is applied with patch tester before the update or now. It only matters to which package you are updating. You have updated to 5.2.2-rc1, that will produce the actual result. When updating from 5.2.0 or 5.2.1 to the patched package created for this PR, then you will get the expected result.

The first step of the update is to unpack the files from the zip. After that, the new script.php extracted from that zip is used. So it does not have an effect if the PR is applied before the update and you are updating to a package which does not contain the fix from this PR.

@dautrich
Copy link

I have tested this item ✅ successfully on 05467d0

Tested with custom update URL https://artifacts.joomla.org/drone/joomla/joomla-cms/5.2-dev/44483/downloads/80427/pr_list.xml


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

@viocassel
Copy link
Contributor

I have tested this item ✅ successfully on 05467d0


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

@joomla-cms-bot joomla-cms-bot removed this from the Joomla! 5.2.2 milestone Nov 19, 2024
@richard67
Copy link
Member Author

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Nov 19, 2024
@richard67 richard67 added this to the Joomla! 5.2.2 milestone Nov 19, 2024
@Hackwar Hackwar merged commit 0dc405d into joomla:5.2-dev Nov 19, 2024
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Nov 19, 2024
@Hackwar
Copy link
Member

Hackwar commented Nov 19, 2024

Thank you for this contribution.

@richard67 richard67 deleted the 5.2-dev-fix-filesystem-fix-folder-not-exists branch November 19, 2024 19:02
@brianteeman
Copy link
Contributor

sorry I'm late to testing this but as it was my bug report just wanted to say I finally got the time to test and confirm it works

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants