No Code Attached Yet
avatar bubi739
bubi739
26 Sep 2023

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.

avatar bubi739 bubi739 - open - 26 Sep 2023
avatar joomla-cms-bot joomla-cms-bot - change - 26 Sep 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Sep 2023
avatar Fedik Fedik - close - 26 Sep 2023
avatar Fedik
Fedik - comment - 26 Sep 2023

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.

avatar Fedik Fedik - change - 26 Sep 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-09-26 10:26:00
Closed_By Fedik
avatar bubi739
bubi739 - comment - 26 Sep 2023

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.

Thank so much!!!!!

Add a Comment

Login with GitHub to post a comment