JREQUEST-GETVAR-001
JRequest::getVar()
JRequest::getVar() and the whole JRequest API
Joomla removed the global request object. There is no class alias and the compatibility plugin does not bring JRequest back. This dies on the first Joomla 4 boot.
JRequest::getVar() → $app->getInput()->get('id')
What you will see
- Class "JRequest" not found
- Call to undefined method JRequest::getVar
- Call to undefined method JRequest::getInt
Symptoms people search
site dies immediately after Joomla 4 upgrade · component 500 on every page · getVar not found
Replace this code
Swap JRequest::getVar() for $app->getInput()->get('id').
Joomla 3
Remove or stop calling this
$id = JRequest::getVar('id');
$cid = JRequest::getInt('cid');Joomla 4 / 6
Use this instead
use Joomla\CMS\Factory;
$app = Factory::getApplication();
$input = $app->getInput();
$id = $input->get('id', 0, 'INT');How to fix it
- 1Get the application, then $app->getInput().
- 2Replace getVar/getInt/getCmd with Input::get() and a filter (INT, CMD, STRING).
- 3Search the whole ZIP for JRequest — every call is a Joomla 4 blocker.
Also known as
JRequest · getVar · getInt · getCmd · JRequest::get
Related issues
- Joomla 3 → 4Joomla API
JError / JException
JError::raiseError() → throw new RuntimeException() / try-catch
- Joomla 3 → 4Joomla API
isAdmin() / isSite()
$app->isAdmin() → $app->isClient('administrator') / isClient('site')
- Joomla 3 → 4Joomla API
Factory::getUri()
JFactory::getUri() → Uri::getInstance()
- Joomla 3 → 4Joomla API
Factory::getXml() / JXMLElement
JFactory::getXML() → SimpleXMLElement
- Joomla 3 → 4Joomla API
Factory::getEditor()
JFactory::getEditor() → Editor::getInstance()
- Joomla 3 → 4Joomla API
JHtmlBatch
JHtmlBatch → Layouts joomla.html.batch.*