JSTRING-CLASS-001
JString
JString / StringHelper
JString was removed in Joomla 4. There is no reliable class alias. UTF-8 string helpers live in the joomla/string package.
JString → Joomla\String\StringHelper
What you will see
- Class "JString" not found
- Call to undefined method JString::
Symptoms people search
utf8 strlen broken · JString after Joomla 4
Replace this code
Swap JString for Joomla\String\StringHelper.
Joomla 3
Remove or stop calling this
echo JString::strtoupper($name);
$len = JString::strlen($utf8);Joomla 4 / 6
Use this instead
use Joomla\String\StringHelper;
echo StringHelper::strtoupper($name);How to fix it
- 1Replace JString with StringHelper.
- 2Add use Joomla\String\StringHelper.
Also known as
JString · StringHelper · phputf8
Related issues
- Joomla 3 → 4PHP
jimport() autoloader calls
jimport('joomla.filesystem.file') → use Joomla\CMS\Filesystem\File;
- Joomla 3 → 4PHP
DS path constant
DS → DIRECTORY_SEPARATOR or /
- Joomla 3 → 4PHP
JPATH_PLATFORM
JPATH_PLATFORM → Do not use — autoload instead
- Joomla 3 → 4Joomla API
JSubMenuHelper
JSubMenuHelper::addEntry() → HTMLHelper::_('sidebar.addEntry') plus the sidebar view placeholder
- Joomla 3 → 4SQL / schema
SQL Server driver
sqlsrv → MySQL / MariaDB / PostgreSQL
- Joomla 3 → 4PHP
mysql_* PHP functions
mysql_query() → Joomla DatabaseInterface / mysqli / PDO