Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Improve error handling for creating autload_psr4.php #44763

Merged
merged 3 commits into from
Jan 26, 2025

Conversation

Hackwar
Copy link
Member

@Hackwar Hackwar commented Jan 21, 2025

Summary of Changes

This PR stems from an update issue. After updating, the /administrator/cache/autoload_psr4.php is deleted and should be regenerated automatically. However the webspace was full and thus the file couldn't be written. In theory we have a fallback for this, however that fallback expects an exception to be thrown, which the code actually doesn't do. This PR adds an additional check for this.

Unfortunately I couldn't replicate the issue itself, since I can't make the folder write-protected on my windows machine and I don't have a Linux machine available right now to test this. So this change was done by me on codereview alone.

Testing Instructions

  1. Delete /administrator/cache/autoload_psr4.php
  2. Make the /administrator/cache folder unwritable
  3. Open the site.

Actual result BEFORE applying this Pull Request

The site displays a 500 error about being unable to include the autoload_psr4.php and the file is not created.

Expected result AFTER applying this Pull Request

The site works like before, even though it might be a bit slower. The autoload_psr4.php is not created.

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

@joomdonation
Copy link
Contributor

I have tested this item ✅ successfully on 67e4d51


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

1 similar comment
@viocassel
Copy link
Contributor

I have tested this item ✅ successfully on 67e4d51


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

@QuyTon
Copy link

QuyTon commented Jan 22, 2025

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jan 22, 2025
@pe7er pe7er self-assigned this Jan 26, 2025
@pe7er
Copy link
Contributor

pe7er commented Jan 26, 2025

I also tested this PR successfully with the permissions on the cache folder set to unwritable (so chmod 500, with only read + execute permission). Site with this PR works without the /administrator/cache/autoload_psr4.php in place.

@pe7er pe7er enabled auto-merge (squash) January 26, 2025 15:29
@pe7er pe7er added this to the Joomla! 5.3.0 milestone Jan 26, 2025
@pe7er pe7er merged commit 88371b1 into joomla:5.3-dev Jan 26, 2025
3 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jan 26, 2025
@pe7er
Copy link
Contributor

pe7er commented Jan 26, 2025

Thanks @Hackwar !

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

Successfully merging this pull request may close these issues.

6 participants