JCONTROLLERLEGACY-CLASS-001
JControllerLegacy
JControllerLegacy class name
JControllerLegacy is a Joomla 3 global class. Joomla 4 still has an alias. Joomla 5 needs the Behaviour – Backward Compatibility plugin. Native Joomla 6 does not load that alias — you get Class "JControllerLegacy" not found.
JControllerLegacy → Joomla\CMS\MVC\Controller\BaseController
What you will see
- Class "JControllerLegacy" not found
- Class 'JControllerLegacy' not found
- Failed to open stream: JControllerLegacy
Symptoms people search
white screen after disabling compatibility plugin · class not found on Joomla 6 · works on Joomla 5 until I turn off backward compatibility
Replace this code
Swap JControllerLegacy for Joomla\CMS\MVC\Controller\BaseController.
Joomla 3
Remove or stop calling this
JControllerLegacy::getInstance();
// or new JControllerLegacy()Joomla 4 / 6
Use this instead
use Joomla\CMS\MVC\Controller\BaseController;
// Call the namespaced class. Do not keep the J prefix.How to fix it
- 1Add a use statement for Joomla\CMS\MVC\Controller\BaseController.
- 2Replace every JControllerLegacy with the short class name from that use line.
- 3Disable Behaviour – Backward Compatibility on a Joomla 5 staging site. If it fatals, this class is still in the code.
Also known as
JControllerLegacy · Joomla\CMS\MVC\Controller\BaseController · class alias · J prefix
Related issues
- Joomla 3 → 4JavaScript
Chosen.js (formbehavior.chosen)
JHtml::_('formbehavior.chosen') → Core styled <select>, Choices.js, or Tom Select
- Joomla 3 → 4MVC
getError() / setError() on models and tables
$model->setError() → Exceptions
- Joomla 5 → 6MVC
Table::getInstance()
JTable::getInstance('Content') → MVC / Table factory
- Joomla 3 → 4MVC
assignRef() on views
$this->assignRef('item', $item) → $this->item = $item
- Joomla 3 → 4MVC
JTableObserver*
JTableObserverTags → Core plugins (tags, content history) — do not subclass observers
- Joomla 3 → 4MVC
FOF 2.x in core
FOFModel / FOFTable → FOF 3 / native Joomla MVC