MVC-GETERROR-001
$model->setError()
getError() / setError() on models and tables
setError/getError were the JError-era API. They linger in Joomla 3 components and fail silently or fatally once JError is gone.
$model->setError() → Exceptions
What you will see
- Call to undefined method ...::getError()
Symptoms people search
save fails with no message · getError empty
Replace this code
Swap $model->setError() for Exceptions.
Joomla 3
Remove or stop calling this
if (!$table->store()) {
$this->setError($table->getError());
return false;
}Joomla 4 / 6
Use this instead
try {
$table->store();
} catch (\RuntimeException $e) {
$this->setError($e->getMessage()); // better: throw
throw $e;
}How to fix it
- 1Throw on failure.
- 2Stop returning false plus getError() as the only signal.
Also known as
getError · setError
There is no 1:1 swap for this one. The architecture changed. If you cannot rewrite it, Infyways can.
Related issues
- Joomla 5 → 6MVC
Table::getInstance()
JTable::getInstance('Content') → MVC / Table factory
- Joomla 3 → 4Joomla API
JGrid
JGrid → HTMLHelper grid / layouts — no 1:1 class
- 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
- Joomla 3 → 4MVC
Experimental Joomla 3 “new MVC” namespace
Joomla\CMS\MVC (J3 experimental) → Original MVC: HtmlView, ListModel, BaseController