APP-REDIRECT-MSG-001
$app->redirect($url, $msg, 'error')
redirect($url, $msg, $type) old signature
Joomla 4 redirect no longer takes message + type. Passing them fatals or ignores.
$app->redirect($url, $msg, 'error') → enqueueMessage then redirect($url)
What you will see
- Too many arguments to function ...::redirect
Symptoms people search
redirect 500 after save
Replace this code
Swap $app->redirect($url, $msg, 'error') for enqueueMessage then redirect($url).
Joomla 3
Remove or stop calling this
$app->redirect('index.php?option=com_lms', 'Saved', 'message');Joomla 4 / 6
Use this instead
$app->enqueueMessage('Saved');
$app->redirect('index.php?option=com_lms');How to fix it
- 1enqueueMessage first.
- 2redirect with URL (and optional HTTP code) only.
Also known as
redirect message type
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()