JHTML-NONPUBLIC-001
JHtml::_('behavior.caption') internals
JHtml::_() calling a non-public helper
Joomla 4 made many JHtml helper methods non-public. Calls that worked as undocumented internals fatal with visibility errors.
JHtml::_('behavior.caption') internals → Public HTMLHelper methods / WebAssetManager only
What you will see
- Call to protected method
- Call to private method
- Call to undefined method
Symptoms people search
html helper protected · behavior helper fatal
Replace this code
Swap JHtml::_('behavior.caption') internals for Public HTMLHelper methods / WebAssetManager only.
Joomla 3
Remove or stop calling this
JHtml::_('behavior.caption');
JHtml::_('somehelper._hiddenMethod');Joomla 4 / 6
Use this instead
// Only call documented public helpers.
HTMLHelper::_('calendar', $value, $name, $id);How to fix it
- 1If the helper is not in the Joomla 4 HTMLHelper docs, stop calling it.
- 2Load the equivalent as a WAM asset.
Also known as
JHtml::_ non-public · protected helper
Related issues
- Joomla 3 → 4Joomla API
JRequest::getVar() and the whole JRequest API
JRequest::getVar() → $app->getInput()->get('id')
- Joomla 3 → 4Joomla API
JError / JException
JError::raiseError() → throw new RuntimeException() / try-catch
- Joomla 3 → 4Joomla API
isAdmin() / isSite()
$app->isAdmin() → $app->isClient('administrator') / isClient('site')
- Joomla 3 → 4Joomla API
Factory::getUri()
JFactory::getUri() → Uri::getInstance()
- Joomla 3 → 4Joomla API
Factory::getXml() / JXMLElement
JFactory::getXML() → SimpleXMLElement
- Joomla 3 → 4Joomla API
Factory::getEditor()
JFactory::getEditor() → Editor::getInstance()