Fatal error when signing out - Help!
Permalink
Hi, I'm buidling a C5 site for a client which is due to go live next week. I'm from a design background so this error is boggling me out. When you sign out of the site I've started getting the error 'Fatal error: Call to a member function isLoggedIn() on a non-object in ... path ... /header.php on line 18'. Has anyone got experience of this or might know how to fix it? Any suggestions would be much appreciated. Thanks
can you paste the code from the header.php file this error refers to ?
Hi Pritam, Here it is:
[<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<!-- Site Header Content //-->
<link href="<?=$this->getThemePath()?>/main.css" type="text/css" media="screen" rel="stylesheet" />
<link href="<?=$this->getThemePath()?>/typography.css" type="text/css" media="screen" rel="stylesheet" />
<!--[if IE]><link href="<?=$this->getThemePath()?>/ie.css" rel="stylesheet" type="text/css" /><![endif]-->
<link href="<?=$this->getThemePath()?>/jquery.jscrollpane.css" type="text/css" media="all" rel="stylesheet" />
<?php global $c; if ($c->isEditMode()) { ?>
<link href="<?=$this->getThemePath()?>/editmode-override.css" type="text/css" media="screen" rel="stylesheet" />
<?php } ?>
<?php global $u;
if ($u -> isLoggedIn ()) { ?>
<link href="<?=$this->getThemePath()?>/loggedin-override.css" type="text/css" media="screen" rel="stylesheet" />
<?php } ?>
<?php
Loader::element('header_required');
?>
<script type="text/javascript" src="<?=$this->getThemePath()?>/scripts/jquery.mousewheel.js"></script>
<script type="text/javascript" src="<?=$this->getThemePath()?>/scripts/jquery.jscrollpane.min.js"></script>
<script type="text/javascript" src="<?=$this->getThemePath()?>/scripts/custom.js"></script>
</head>
<body class="threefd" id="<?php echo $c->getCollectionHandle()?>">]
Thanks, Andy
[<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<!-- Site Header Content //-->
<link href="<?=$this->getThemePath()?>/main.css" type="text/css" media="screen" rel="stylesheet" />
<link href="<?=$this->getThemePath()?>/typography.css" type="text/css" media="screen" rel="stylesheet" />
<!--[if IE]><link href="<?=$this->getThemePath()?>/ie.css" rel="stylesheet" type="text/css" /><![endif]-->
<link href="<?=$this->getThemePath()?>/jquery.jscrollpane.css" type="text/css" media="all" rel="stylesheet" />
<?php global $c; if ($c->isEditMode()) { ?>
<link href="<?=$this->getThemePath()?>/editmode-override.css" type="text/css" media="screen" rel="stylesheet" />
<?php } ?>
<?php global $u;
if ($u -> isLoggedIn ()) { ?>
<link href="<?=$this->getThemePath()?>/loggedin-override.css" type="text/css" media="screen" rel="stylesheet" />
<?php } ?>
<?php
Loader::element('header_required');
?>
<script type="text/javascript" src="<?=$this->getThemePath()?>/scripts/jquery.mousewheel.js"></script>
<script type="text/javascript" src="<?=$this->getThemePath()?>/scripts/jquery.jscrollpane.min.js"></script>
<script type="text/javascript" src="<?=$this->getThemePath()?>/scripts/custom.js"></script>
</head>
<body class="threefd" id="<?php echo $c->getCollectionHandle()?>">]
Thanks, Andy
I am not an expert in Php, but the 18th line as mentioned in your error message refers to this
Why is the css being overriden when a user is logged in ?
<?php global $u; if ($u -> isLoggedIn ()) { ?> <link href="<?=$this->getThemePath()?>/loggedin-override.css" type="text/css" media="screen" rel="stylesheet" /> <?php } ?>
Why is the css being overriden when a user is logged in ?
I've actually just removed that and it fixes the problem - thanks.
I wanted to provide an alternative stylesheet to position the site lower down the page as the C5 nav bar at the top was getting in the way when logged in.
I'd still like to do this but Obviously that code snippet is conflicting with something. For now I'll just remove it.
It would be good to know what the correct code is though for adding an alternative stylesheet when logged in though.
Thanks for your help.
Andy
I wanted to provide an alternative stylesheet to position the site lower down the page as the C5 nav bar at the top was getting in the way when logged in.
I'd still like to do this but Obviously that code snippet is conflicting with something. For now I'll just remove it.
It would be good to know what the correct code is though for adding an alternative stylesheet when logged in though.
Thanks for your help.
Andy
are the editable regions getting overlapped due to which you were trying to override the stylesheet ?
To avoid the editable regions to overlap from each other, Add this to the overlapping block areas in your theme
<?php
global $c;
if ($c->isEditMode()) {
echo '<div id="cms_fix001"></div>';
}
?>
This code works when in edit mode, add the below style to your CSS
#cms_fix001
{
padding-bottom:60px;
}
<?php
global $c;
if ($c->isEditMode()) {
echo '<div id="cms_fix001"></div>';
}
?>
This code works when in edit mode, add the below style to your CSS
#cms_fix001
{
padding-bottom:60px;
}