JMODELITEM-CLASS-001
JModelItem
JModelItem class name
JModelItem 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 "JModelItem" not found.
JModelItem → Joomla\CMS\MVC\Model\ItemModel
What you will see
- Class "JModelItem" not found
- Class 'JModelItem' not found
- Failed to open stream: JModelItem
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 JModelItem for Joomla\CMS\MVC\Model\ItemModel.
Joomla 3
Remove or stop calling this
JModelItem::getInstance();
// or new JModelItem()Joomla 4 / 6
Use this instead
use Joomla\CMS\MVC\Model\ItemModel;
// Call the namespaced class. Do not keep the J prefix.How to fix it
- 1Add a use statement for Joomla\CMS\MVC\Model\ItemModel.
- 2Replace every JModelItem 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
JModelItem · Joomla\CMS\MVC\Model\ItemModel · 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()