User tests: Successful: Unsuccessful:
Pull Request for Issue # .
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:
I could not find an easy way to make this operation fail on normal condition. So you can just perform simple test below:
Works, with potential errors if cache file is partially written
Works, no potential errors
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
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration Language & Strings Libraries |
| Labels |
Added:
Language Change
PR-6.0-dev
|
||
Tested with JBT
language-en-GB-mod_login.ini.*.php has been partially deleted and the site fails with 500 and stack traceadministrator\cache\language and used files are recreated on next loadthrow new FilesystemException('Debug exception'); before line 501 to test the catch block
20 files are created:
ls -1 administrator/cache/language
administrator-language-en-GB-com_content.ini.1765117314.php
administrator-language-en-GB-plg_actionlog_joomla.ini.1765117314.php
administrator-language-en-GB-plg_system_debug.ini.1765117314.php
administrator-language-en-GB-plg_task_checkfiles.ini.1765117314.php
administrator-language-en-GB-plg_task_deleteactionlogs.ini.1765117314.php
administrator-language-en-GB-plg_task_globalcheckin.ini.1765117314.php
administrator-language-en-GB-plg_task_privacyconsent.ini.1765117314.php
administrator-language-en-GB-plg_task_requests.ini.1765117314.php
administrator-language-en-GB-plg_task_rotatelogs.ini.1765117314.php
administrator-language-en-GB-plg_task_sessiongc.ini.1765117314.php
administrator-language-en-GB-plg_task_sitestatus.ini.1765117314.php
administrator-language-en-GB-plg_task_updatenotification.ini.1765117314.php
language-en-GB-com_ajax.ini.1765117314.php
language-en-GB-com_content.ini.1765117314.php
language-en-GB-joomla.ini.1765117314.php
language-en-GB-lib_joomla.ini.1765117314.php
language-en-GB-mod_breadcrumbs.ini.1765117314.php
language-en-GB-mod_login.ini.1765117314.php
language-en-GB-mod_menu.ini.1765117314.php
language-en-GB-tpl_cassiopeia.ini.1765117314.php
But only 10 log entries?
$ cat administrator/logs/everything.php
#
#<?php die('Forbidden.'); ?>
#Date: 2025-12-13 16:26:39 UTC
#Software: Joomla! 6.0.2-dev+pr.46545 Development [ Kuimarisha ] 25-November-2025 17:01 UTC
#Fields: datetime priority clientip category message
2025-12-13T16:41:02+00:00 WARNING 3.160.39.15 language JLIB_LANGUAGE_ERROR_CANNOT_WRITE_CACHE
2025-12-13T16:41:02+00:00 WARNING 3.160.39.15 language Unable to write cache file for /administrator/cache/language/administrator-language-en-GB-plg_actionlog_joomla.ini.1765117314.php.
2025-12-13T16:41:02+00:00 WARNING 3.160.39.15 language Unable to write cache file for /administrator/cache/language/language-en-GB-tpl_cassiopeia.ini.1765117314.php.
2025-12-13T16:41:02+00:00 WARNING 3.160.39.15 language Unable to write cache file for /administrator/cache/language/language-en-GB-com_content.ini.1765117314.php.
2025-12-13T16:41:02+00:00 WARNING 3.160.39.15 language Unable to write cache file for /administrator/cache/language/language-en-GB-mod_menu.ini.1765117314.php.
2025-12-13T16:41:02+00:00 WARNING 3.160.39.15 language Unable to write cache file for /administrator/cache/language/language-en-GB-mod_login.ini.1765117314.php.
2025-12-13T16:41:02+00:00 WARNING 3.160.39.15 language Unable to write cache file for /administrator/cache/language/language-en-GB-mod_breadcrumbs.ini.1765117314.php.
2025-12-13T16:41:02+00:00 WARNING 3.160.39.15 language Unable to write cache file for /administrator/cache/language/administrator-language-en-GB-com_content.ini.1765117314.php.
2025-12-13T16:41:02+00:00 WARNING 3.160.39.15 language Unable to write cache file for /administrator/cache/language/administrator-language-en-GB-plg_system_debug.ini.1765117314.php.
2025-12-13T16:46:04+00:00 WARNING 3.160.39.15 language Unable to write cache file for /administrator/cache/language/language-en-GB-com_ajax.ini.1765117314.php.
@joomdonation Can you reproduce this or do you have an explanation for it? I would like to proceed with an issue tracker test.
I could not reproduce that issue ... it is also un-related to this PR
Thank you for checking 👍
I have tested this item ✅ successfully on 7fa9554
Current 6.0-dev Re-Test with JBT
administrator/cache/language/ files, counted and saved 10 created language cache filesgh pr checkout 46545, deleted all administrator/cache/language/ files| Status | Pending | ⇒ | Ready to Commit |
RTC
I have tested this item ✅ successfully on 7fa9554
I have successfully tested this.
(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.