JHTML-BEHAVIOR-FRAMEWORK-001
JHtml::_('behavior.framework')
behavior.framework (MooTools)
Joomla 4 removed MooTools. behavior.framework and SqueezeBox (behavior.modal) do not exist. The compatibility plugin does not restore them.
JHtml::_('behavior.framework') → Do not load MooTools — use vanilla JS or WebAssetManager
What you will see
- Call to undefined method
- SqueezeBox is not defined
- MooTools is not defined
Symptoms people search
modal popup does nothing · click edit and nothing opens · mootools error in console
Replace this code
Swap JHtml::_('behavior.framework') for Do not load MooTools — use vanilla JS or WebAssetManager.
Joomla 3
Remove or stop calling this
JHtml::_('behavior.framework');
JHtml::_('behavior.modal');Joomla 4 / 6
Use this instead
// Remove these lines. SqueezeBox and MooTools are gone.
// Use Bootstrap 5 modal or a <dialog> element.How to fix it
- 1Delete behavior.framework, behavior.modal, behavior.caption, behavior.tooltip.
- 2Replace modal popups with Bootstrap 5 data-bs-toggle="modal" or HTMLHelper bootstrap.renderModal.
- 3Rewrite any MooTools JavaScript ($$, Fx, SqueezeBox) to vanilla JS.
Also known as
behavior.framework · MooTools · SqueezeBox · behavior.modal · behavior.caption · behavior.tooltip
There is no 1:1 swap for this one. The architecture changed. If you cannot rewrite it, Infyways can.
Related issues
- Joomla 3 → 4JavaScript
JHtmlBootstrap::modal()
JHtmlBootstrap::modal() → HTMLHelper::_('bootstrap.renderModal')
- Joomla 3 → 4JavaScript
Chosen.js (formbehavior.chosen)
JHtml::_('formbehavior.chosen') → Core styled <select>, Choices.js, or Tom Select
- Joomla 3 → 4Joomla API
JHtmlBatch
JHtmlBatch → Layouts joomla.html.batch.*
- Joomla 4 → 5JavaScript
addScript() / addStyleSheet() vs WebAssetManager
$doc->addScript() → WebAssetManager + joomla.asset.json
- Joomla 5 → 6JavaScript
Assuming jQuery is always on the page
JHtml::_('jquery.framework') → Declare jQuery in joomla.asset.json only if you still need it
- Joomla 5 → 6JavaScript
Joomla.JText (JavaScript)
Joomla.JText._() → Joomla.Text._() + Text::script() in PHP