JMODELFORM-CLASS-001
JModelForm
JModelForm class name
JModelForm 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 "JModelForm" not found.
JModelForm → Joomla\CMS\MVC\Model\FormModel
What you will see
- Class "JModelForm" not found
- Class 'JModelForm' not found
- Failed to open stream: JModelForm
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 JModelForm for Joomla\CMS\MVC\Model\FormModel.
Joomla 3
Remove or stop calling this
JModelForm::getInstance();
// or new JModelForm()Joomla 4 / 6
Use this instead
use Joomla\CMS\MVC\Model\FormModel;
// Call the namespaced class. Do not keep the J prefix.How to fix it
- 1Add a use statement for Joomla\CMS\MVC\Model\FormModel.
- 2Replace every JModelForm 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
JModelForm · Joomla\CMS\MVC\Model\FormModel · class alias · J prefix
Related issues
- Joomla 3 → 4SQL / schema
MyISAM engine in install SQL
ENGINE=MyISAM → ENGINE=InnoDB
- Joomla 3 → 4PHP
mysql_* PHP functions
mysql_query() → Joomla DatabaseInterface / mysqli / PDO
- 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 → 4Joomla API
JMenuItem public $params
$item->params->get('show_title') → getParams() / setParams()
- Joomla 3 → 4Joomla API
Media field #joomlaImage:// paths
images/lms/hero.jpg (raw path) → HTMLHelper::cleanImageURL() / MediaHelper::getCleanMediaFieldValue()