Hello, I have the error on my website "Error: 0 - Class "JRequest" not found" when I switched to Joomla 4 and I think it is due to the index.php code:
defined('_JEXEC') or die;
// A code to show the offline.php page for the demo
if (JRequest::getCmd("tmpl", "index") == "offline") {
if (is_file(JPATH_ROOT . "/templates/" . $this->template . "/offline.php")) {
require_once(JPATH_ROOT . "/templates/" . $this->template . "/offline.php");
} else {
if (is_file(JPATH_ROOT . "/templates/system/offline.php")) {
require_once(JPATH_ROOT . "/templates/system/offline.php");
}
}
} else {
// Include Variables
include_once(JPATH_ROOT . "/templates/" . $this->template . '/icetools/vars.php');
?>
Can you help me?? Thanks.
Labels |
Added:
No Code Attached Yet
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-09-26 10:26:00 |
Closed_By | ⇒ | Fedik |
Change your
JRequest::getCmd("tmpl", "index") == "offline"
toJoomla\CMS\Factory::getApplication()->getInput()->get('tmpl') === 'offline'
For more help you always can ask on Joomla forum https://forum.joomla.org/
I closing the issue as it is not a bug.
Thank so much!!!!!
Change your
JRequest::getCmd("tmpl", "index") == "offline"
to
Joomla\CMS\Factory::getApplication()->getInput()->get('tmpl') === 'offline'
For more help you always can ask on Joomla forum https://forum.joomla.org/
I closing the issue as it is not a bug.