Getting Error in admin Configuration after clearing Browser Cache & History. I am getting the below error on refresh.
Fatal error: Call to a member function getUsername() on a non-object
in
/var/www/app/design/adminhtml/default/default/template/page/header.phtml
on line 33
Below is my file code on line number 33
<?php echo $this->__("Logged in as %s", $this->escapeHtml($this->getUser()->getUsername())) ?><span class="separator">|</span><?php echo $this->formatDate(null, 'full') ?><span class="separator">|</span><a href="<?php echo $this->getLogoutLink() ?>" class="link-logout"><?php echo $this->__('Log Out') ?></a>
Best Answer
Looks like you don't have any method name
Username
in$this->getUser()
.First do one thing try to see the all method and variables in
$this->getUser()
usingvar_dump
method. And then search foruser
.Hope that will help you to debug your problem.