[6.0] Language cache error handling improvement#46545
[6.0] Language cache error handling improvement#46545Bodge-IT merged 4 commits intojoomla:6.0-devfrom
Conversation
|
I have tested this item ✅ successfully on 7fa9554 (In case this is important (I doubt it): when going back into the backend and clicking around, the number of cache files that come back into the administrator/cache/language directory is not always the same initially...) most of the time it's 78 or 90, but sometimes its 58, and eventually climbs up to 120. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46545. |
|
Tested with JBT
Listings20 files are created: But only 10 log entries? @joomdonation Can you reproduce this or do you have an explanation for it? I would like to proceed with an issue tracker test. |
|
@muhme So you are saying that in your case, number of cache files is not the same with number of log entries? If so, I could not reproduce that issue. And in case logging is not working for some reasons, it is also un-related to this PR. |
Thank you for checking 👍 |
|
I have tested this item ✅ successfully on 7fa9554
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46545. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46545. |
|
Thanks @joomdonation for the fix, and to all the testers who made it possible. |
6.0.2 joomla/joomla-cms#46593 + (upmerge) 6.0.3 joomla/joomla-cms#46763 + (upmerge) joomla/joomla-cms#46828 + (upmerge) joomla/joomla-cms#46686 + (upmerge) joomla/joomla-cms#46545 + 6.0.4 joomla/joomla-cms#47398 +
Pull Request for Issue # .
Summary of Changes
This PR improves the robustness of Joomla’s language cache handling. Currently, if a language cache file is only partially written (e.g., due to low disk space, write interruption, or unexpected I/O failure), the corrupted cache file will remain on disk. On the next request, Joomla attempts to include this broken file, which may lead to PHP errors, warnings, or unexpected behavior.
This PR introduces safer handling of such scenarios by:
Testing Instructions
I could not find an easy way to make this operation fail on normal condition. So you can just perform simple test below:
Actual result BEFORE applying this Pull Request
Works, with potential errors if cache file is partially written
Expected result AFTER applying this Pull Request
Works, no potential errors
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