Language Change PR-6.0-dev Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
7 Dec 2025

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:

  • Removing the corrupted cache file immediately when the write operation fails, ensuring Joomla does not load an invalid cache file in future requests.
  • Logging the failure so administrators can see errors from log if needed.

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:

  • Use Joomla 6.0
  • Apply patch
  • Delete language cache folder (administrator\cache\language)
  • Access to your site again, make sure there is no error
  • Check language cache folder (administrator\cache\language) and make sure the cache files still being created as before.

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

avatar joomdonation joomdonation - open - 7 Dec 2025
avatar joomdonation joomdonation - change - 7 Dec 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Dec 2025
Category Administration Language & Strings Libraries
avatar joomdonation joomdonation - change - 7 Dec 2025
Labels Added: Language Change PR-6.0-dev
avatar exlemor exlemor - test_item - 8 Dec 2025 - Tested successfully
avatar exlemor
exlemor - comment - 8 Dec 2025

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.

avatar muhme
muhme - comment - 13 Dec 2025

Tested with JBT

  • Seen the problem before: File language-en-GB-mod_login.ini.*.php has been partially deleted and the site fails with 500 and stack trace
  • Installed from PR's full package
    • ✅ Deleted all files in administrator\cache\language and used files are recreated on next load
    • Inserted throw new FilesystemException('Debug exception'); before line 501 to test the catch block
      • The first entry is untranslated, as the translation is not cache-loaded, right?
      • ⚠️ But, I am wondering for 19 written cache files, there are only 10 log entries? Why?
Listings

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.

avatar joomdonation
joomdonation - comment - 19 Dec 2025

@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.

avatar muhme
muhme - comment - 28 Dec 2025

@joomdonation

I could not reproduce that issue ... it is also un-related to this PR

Thank you for checking 👍

avatar muhme muhme - test_item - 28 Dec 2025 - Tested successfully
avatar muhme
muhme - comment - 28 Dec 2025

I have tested this item ✅ successfully on 7fa9554

Current 6.0-dev Re-Test with JBT

  • Note: As the created files are depending of the system activites, I didn't used backend login, simple waited > 60 seconds as JBT runs scheduler crontab based every minute
  • Before PR: Deleted all administrator/cache/language/ files, counted and saved 10 created language cache files
  • Applied PR with gh pr checkout 46545, deleted all administrator/cache/language/ files
  • Found and compared identical 10 language cache files created

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46545.
avatar richard67 richard67 - change - 29 Dec 2025
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 29 Dec 2025

RTC


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

Add a Comment

Login with GitHub to post a comment