JFACTORY-GETAPPLICATION-001
JFactory::getApplication('site')
Factory::getApplication($client) arguments
You cannot ask Factory for a different client anymore. The argument is ignored or removed. There is one application.
JFactory::getApplication('site') → Factory::getApplication() with no client; then isClient()
Symptoms people search
always got site app in admin · getApplication site
Replace this code
Swap JFactory::getApplication('site') for Factory::getApplication() with no client; then isClient().
Joomla 3
Remove or stop calling this
$app = JFactory::getApplication('site');
$admin = JFactory::getApplication('administrator');Joomla 4 / 6
Use this instead
$app = Factory::getApplication();
if ($app->isClient('administrator')) {}How to fix it
- 1Call getApplication() with no arguments.
- 2Branch with isClient('site'|'administrator').
Also known as
getApplication('site') · getApplication('administrator')
Related issues
- Joomla 3 → 4Joomla API
JRequest::getVar() and the whole JRequest API
JRequest::getVar() → $app->getInput()->get('id')
- 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()