Class 'JString not found Joomla 4.0

General questions regarding the use of languages in Joomla! 4.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Kikiyo
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Jan 29, 2008 5:56 pm

Re: Class 'JString not found Joomla 4.0

Post by Kikiyo » Wed Sep 14, 2022 4:20 pm

Similar here, using Macedonian language pack.
Replacing "JString" with "StringHelper" in "public static function transliterate", and adding "use Joomla\String\StringHelper;" just below "defined('_JEXEC') or die;" solved the problem partially.

Now there is "An error has occurred.
0 Call to a member function get() on null" on the main Administrator menu link "Home dashboard" showing.
You do not have the required permissions to view the files attached to this post.

gamod
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Oct 18, 2022 6:37 am

Re: Class 'JString not found Joomla 4.0

Post by gamod » Tue Oct 18, 2022 6:58 am

Balazs wrote:
Sat Sep 04, 2021 11:28 pm
I also got this error in the Hungarian language pack, but I fixed it. The Joomla 3 Hungarian language pack includes an hu-HU.localise.php, which has a transliterate function that uses JString, but Joomla 4 no longer includes JString.
In the transliterate function I replaced the following line:
$str = JString::strtolower($string);
for this line:
$str = StringHelper::strtolower($string);
Also, after the header, I added the following line:
use Joomla\String\StringHelper;

localise.php.txt
Thank You!
Your modified php file saved my Hungarian site!

Krisi
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Nov 23, 2022 6:13 am

Re: Class 'JString not found Joomla 4.0

Post by Krisi » Wed Nov 23, 2022 6:24 am

I got the same problem after upgrading to Joomla 4.2.5 on a multi-language website.
I did all the pre-upgrade preparations.
Purged Akeeba and FOF files.
Everything works well except this error on at least the main page in Czech language.

Krisi
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Nov 23, 2022 6:13 am

Re: Class 'JString not found Joomla 4.0

Post by Krisi » Thu Nov 24, 2022 6:13 am

Balazs wrote:
Sat Sep 04, 2021 11:28 pm

Also, after the header, I added the following line:
use Joomla\String\StringHelper;

where exactly to put that in?


Post Reply

Return to “Language - Joomla! 4.x”