Skip to content

Conversation

@joomdonation
Copy link
Contributor

Pull Request for Issue #46499.

Summary of Changes

PR #45289 introduced language caching to improve performance. However, it might causes error as described in the plugin #46499 if the cache file is corrupted for some reasons. This PR adds some code to prevent that. In case the included cache file does not return array, the cache file will be deleted so that it will be re-generated.

Testing Instructions

  • Uses Joomla 6
  • Look at administrator\cache\language folder, find the file administrator-language-en-GB-plg_system_guidedtours.ini.XYX.php, edit it, change the content to just the code below to make it broken:
<?php
defined('_JEXEC') or die;
  • Access to administrator area of your site. You should see fatal error

Actual result BEFORE applying this Pull Request

You get fatal error

Expected result AFTER applying this Pull Request

No error, even if cacch language file is broken

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

@richard67 richard67 added the bug label Dec 6, 2025
@exlemor
Copy link

exlemor commented Dec 6, 2025

I have tested this item ✅ successfully on cada051

I have tested this successfully, Thank you @joomdonation!


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

@alikon
Copy link
Contributor

alikon commented Dec 7, 2025

I have tested this item ✅ successfully on cada051


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

@joomla-cms-bot joomla-cms-bot removed the bug label Dec 7, 2025
@alikon
Copy link
Contributor

alikon commented Dec 7, 2025

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Dec 7, 2025
@alikon alikon added the bug label Dec 7, 2025
@Lacis
Copy link

Lacis commented Dec 7, 2025

Remove admin/cache, language fold+ autoload_psr4.php, copied J601 admin/language and language folder.

@joomdonation
Copy link
Contributor Author

@Lacis Your last comment is not very clear. Could you please explain more details about it?

@Bodge-IT
Copy link
Contributor

Remove admin/cache, language fold+ autoload_psr4.php, copied J601 admin/language and language folder.

@Lacis Please could you expand on your comment to @joomdonation so that we can progress the PR

@Lacis
Copy link

Lacis commented Dec 10, 2025

I wrote how I resolve error, not work front page and admin:

$result = false;
$strings = $this->parse($fileName);

    if ($strings !== []) {
        $this->strings = array_replace($this->strings, $strings, $this->override);
        $result        = true;
    }

    // Record the result of loading the extension's file.
    if (!isset($this->paths[$extension])) {

Remove admin/cache including language folder and autoload_psr4.php.
Copied J601 admin/language and language folder joomla ini files. Of course not remove plugins language files.

@joomdonation
Copy link
Contributor Author

@Lacis Your response is still not very clear to me. From what I see, you did not make the code change. What actually fixed the issue for you here is you removed administrator/cache folder and the broken cache language file was removed, so the error is gone

This PR solves the root cause of the error. When the cache language file broken, it will be deleted and the system will continue parse and return result of the actual language file, error won't happen anymore

@Bodge-IT This PR can be merged

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

Labels

bug PR-6.0-dev RTC This Pull Request is Ready To Commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants