[BUG]: Missing method form the StringHelper class #1322

Closed
opened 2026-10-09 09:35:01 +00:00 by Safweb · 1 comment

What Happened?

I get this error after installing a component; the error is located in /src/View/Looks. It works when I edit the file, but the error naturally reappears when I package and install the component.

<html>

An error has occurred.

0 Call to undefined method Demo\Joomla\Utilities\StringHelper::sanitize()

Call Stack

| Function | Location

-- | -- | --
1 | () | JROOT/administrator/components/com_demo/src/View/Details/HtmlView.php:351
2 | Demo\Component\Demo\Administrator\View\Details\HtmlView->sanitize() | JROOT/administrator/components/com_demo/src/View/Details/HtmlView.php:197
3 | Demo\Component\Demo\Administrator\View\Details\HtmlView->display() | JROOT/libraries/src/MVC/Controller/BaseController.php:697
4 | Joomla\CMS\MVC\Controller\BaseController->display() | JROOT/administrator/components/com_demo/src/Controller/DisplayController.php:52
5 | Demo\Component\Demo\Administrator\Controller\DisplayController->display() | JROOT/libraries/src/MVC/Controller/BaseController.php:730
6 | Joomla\CMS\MVC\Controller\BaseController->execute() | JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143
7 | Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() | JROOT/libraries/src/Component/ComponentHelper.php:361
8 | Joomla\CMS\Component\ComponentHelper::renderComponent() | JROOT/libraries/src/Application/AdministratorApplication.php:150
9 | Joomla\CMS\Application\AdministratorApplication->dispatch() | JROOT/libraries/src/Application/AdministratorApplication.php:206
10 | Joomla\CMS\Application\AdministratorApplication->doExecute() | JROOT/libraries/src/Application/CMSApplication.php:320
11 | Joomla\CMS\Application\CMSApplication->execute() | JROOT/administrator/includes/app.php:58
12 | require_once() | JROOT/administrator/index.php:32

</html>

Steps to reproduce the Bug

return StringHelper::sanitize($var, $this->_charset ?? 'UTF-8', $shorten, $length);
to
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);

Which Joomla version are you compiling in?

6.1.4

Which PHP version are you compiling in?

8.4

Which Joomla versions are you targeting?

6.1.4

Which PHP version are you targeting?

8.4

Which Web server is JCB running on?

Firefox 157.1

Which Relational Database is JCB running on?

MariaDB-10

Which OS is JCB running on?

Localhost via UNIX socket

Which JCB version are you using?

6.2.0

Where in JCB did this issue occur?

Installation of a component

On which browsers did you encounter the issue?

No response

Additional Comments

No response

### What Happened? I get this error after installing a component; the error is located in `/src/View/Looks`. It works when I edit the file, but the error naturally reappears when I package and install the component. <html><body> <!--StartFragment--><h1>An error has occurred.</h1> <blockquote class="blockquote"> <span class="badge bg-secondary">0</span> Call to undefined method Demo\Joomla\Utilities\StringHelper::sanitize() </blockquote> <div> <h2 id="caption">Call Stack</h2> # | Function | Location -- | -- | -- 1 | () | JROOT/administrator/components/com_demo/src/View/Details/HtmlView.php:351 2 | Demo\Component\Demo\Administrator\View\Details\HtmlView->sanitize() | JROOT/administrator/components/com_demo/src/View/Details/HtmlView.php:197 3 | Demo\Component\Demo\Administrator\View\Details\HtmlView->display() | JROOT/libraries/src/MVC/Controller/BaseController.php:697 4 | Joomla\CMS\MVC\Controller\BaseController->display() | JROOT/administrator/components/com_demo/src/Controller/DisplayController.php:52 5 | Demo\Component\Demo\Administrator\Controller\DisplayController->display() | JROOT/libraries/src/MVC/Controller/BaseController.php:730 6 | Joomla\CMS\MVC\Controller\BaseController->execute() | JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143 7 | Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() | JROOT/libraries/src/Component/ComponentHelper.php:361 8 | Joomla\CMS\Component\ComponentHelper::renderComponent() | JROOT/libraries/src/Application/AdministratorApplication.php:150 9 | Joomla\CMS\Application\AdministratorApplication->dispatch() | JROOT/libraries/src/Application/AdministratorApplication.php:206 10 | Joomla\CMS\Application\AdministratorApplication->doExecute() | JROOT/libraries/src/Application/CMSApplication.php:320 11 | Joomla\CMS\Application\CMSApplication->execute() | JROOT/administrator/includes/app.php:58 12 | require_once() | JROOT/administrator/index.php:32 </div><!--EndFragment--> </body> </html> ### Steps to reproduce the Bug return StringHelper::sanitize($var, $this->_charset ?? 'UTF-8', $shorten, $length); to return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); ### Which Joomla version are you compiling in? 6.1.4 ### Which PHP version are you compiling in? 8.4 ### Which Joomla versions are you targeting? 6.1.4 ### Which PHP version are you targeting? 8.4 ### Which Web server is JCB running on? Firefox 157.1 ### Which Relational Database is JCB running on? MariaDB-10 ### Which OS is JCB running on? Localhost via UNIX socket ### Which JCB version are you using? 6.2.0 ### Where in JCB did this issue occur? Installation of a component ### On which browsers did you encounter the issue? _No response_ ### Additional Comments _No response_
Safweb added the Bug label 2026-10-09 09:35:02 +00:00
Llewellyn changed title from [BUG]: to [BUG]: Missing method form the StringHelper class 2026-10-09 09:54:45 +00:00
Owner

Hi @Safweb, The latest JCB release includes new and updated Super Powers. After updating JCB, you also need to synchronize the Powers stored in your local JCB installation. Otherwise, compilation will use older classes and cause errors such as Call to undefined method StringHelper::sanitize(). Since the StringHelper class is one of the updated powers, so it needs to be synchronized with the Super-Power repository.

How to update your Super Powers

Option 1 - Reset existing Powers: Open JCB -> Powers, select the Powers the powers that was updated, (eg. Utilities.StringHelper) and click Reset. JCB will synchronize those Powers with the latest versions from the repository's master branch. Note that Reset replaces local changes to the selected Powers.

Option 2 - Pull updated and new Powers: Open JCB -> Powers -> Pull, select the Super Powers repository, and open its Super Power Index. Select the Powers listed below and click Pull to update existing Powers and import the new ones.

Once synchronized, compile your component again.

Powers included in this update

7 new Powers have been introduced, and 22 existing Powers received code updates.

Show all new and updated Super Powers

New Powers (7)

JCB.Abstraction.Mapper
JCB.Abstraction.MapperDouble
JCB.Abstraction.MapperSingle
JCB.Interfaces.Mapperdoublejoininterface
Utilities
Utilities ImageHelper
Utilities Regex Helper

Existing Powers with code updates (22)

JCB.Import.Value
JCB.Markdown.Html
JCB.User.IdentityTrait

Joomla.File.Manager
Joomla.Utilities.UserHelper

String Classfunction Helper
String Plugin Helper

Utilities Class Helper
Utilities Extrusion GetHelper
Utilities FileHelper
Utilities GetHelper
Utilities GuidHelper
Utilities Json Helper
Utilities Math Helper
Utilities Object Helper
Utilities String Helper
Utilities UploadHelper

VDM.Data.Subform
VDM.Data.UsersSubform
VDM.Interfaces.File.HandlerInterface
VDM.Interfaces.Repository.ContentsInterface
VDM.Interfaces.Repository.WikiInterface

Repository: joomengine/super-powers

Hi @Safweb, The latest JCB release includes new and updated Super Powers. After updating JCB, you also need to synchronize the Powers stored in your local JCB installation. Otherwise, compilation will use older classes and cause errors such as `Call to undefined method StringHelper::sanitize()`. Since the `StringHelper` class is one of the updated powers, so it needs to be synchronized with the Super-Power repository. ## How to update your Super Powers **Option 1 - Reset existing Powers:** Open **JCB -> Powers**, select the Powers the powers that was updated, (eg. `Utilities.StringHelper`) and click **Reset**. JCB will synchronize those Powers with the latest versions from the repository's `master` branch. Note that Reset replaces local changes to the selected Powers. **Option 2 - Pull updated and new Powers:** Open **JCB -> Powers -> Pull**, select the **Super Powers** repository, and open its **Super Power Index**. Select the Powers listed below and click **Pull** to update existing Powers and import the new ones. Once synchronized, **compile your component again**. ## Powers included in this update **7 new Powers** have been introduced, and **22 existing Powers** received code updates. <details> <summary><strong>Show all new and updated Super Powers</strong></summary> ### New Powers (7) ```text JCB.Abstraction.Mapper JCB.Abstraction.MapperDouble JCB.Abstraction.MapperSingle JCB.Interfaces.Mapperdoublejoininterface Utilities Utilities ImageHelper Utilities Regex Helper ``` ### Existing Powers with code updates (22) ```text JCB.Import.Value JCB.Markdown.Html JCB.User.IdentityTrait Joomla.File.Manager Joomla.Utilities.UserHelper String Classfunction Helper String Plugin Helper Utilities Class Helper Utilities Extrusion GetHelper Utilities FileHelper Utilities GetHelper Utilities GuidHelper Utilities Json Helper Utilities Math Helper Utilities Object Helper Utilities String Helper Utilities UploadHelper VDM.Data.Subform VDM.Data.UsersSubform VDM.Interfaces.File.HandlerInterface VDM.Interfaces.Repository.ContentsInterface VDM.Interfaces.Repository.WikiInterface ``` </details> **Repository:** [joomengine/super-powers](https://github.com/joomengine/super-powers/)
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joomla/Component-Builder#1322