Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

after upgrade from 1.5.1.0 to 1.7.0 i got some Fatal error Call to a member function getUsername() on a non-object in
 
sevenusd
Member
 
Avatar
Total Posts:  53
Joined:  2010-09-01
 

Fatal error: Call to a member function getUsername() on a non-object in /home/wwwroot/etsivan/app/design/adminhtml/default/default/template/page/header.phtml on line 33
any help will be appreciation

 
Magento Community Magento Community
Magento Community
Magento Community
 
kevinconroy
Jr. Member
 
Total Posts:  7
Joined:  2009-01-22
 

I’m also having a similar problem.

Fatal errorCall to a member function getUsername() on a non-object in magento/app/design/adminhtml/default/default/template/page/header.phtml on line 33

I’ve verified that my var folder has proper write access.

There’s a temporary work around, though. Go to yourserver.com/magento/downloader (or whatever you appropriate path is) and log in via the Magento Connect screen. Then click “Return to admin” and you can get to your backend.

If anyone finds a solution to get the error I’d love to hear it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kevinconroy
Jr. Member
 
Total Posts:  7
Joined:  2009-01-22
 

Just solved this! Found another helpful thread in the forum which provided the solution.

My instance of Magento had some customizations, specifically I had made edits to magento/app/design/adminhtml/default/default/layout/main.xml

There were new additions made to this file during the 1.7 upgrade, and if you made customizations to this file, then you may have omitted the new sections. Here’s what you need to add if you don’t already have it:

<adminhtml_dashboard_customersmost>
            <
block type="core/text_list" name="root" output="toHtml">
                <
block type="adminhtml/dashboard_tab_customers_most" name="adminhtml.dashboard.tab.customers.most" />
            </
block>
        </
adminhtml_dashboard_customersmost>

        <
adminhtml_dashboard_customersnewest>
            <
block type="core/text_list" name="root" output="toHtml">
                <
block type="adminhtml/dashboard_tab_customers_newest" name="adminhtml.dashboard.tab.customers.newest" />
            </
block>
        </
adminhtml_dashboard_customersnewest>

        <
adminhtml_dashboard_productsviewed>
            <
block type="core/text_list" name="root" output="toHtml">
                <
block type="adminhtml/dashboard_tab_products_viewed" name="adminhtml.dashboard.tab.products.viewed" />
            </
block>
        </
adminhtml_dashboard_productsviewed>

        <
adminhtml_index_login>
            <
block type="core/text_list" name="root" output="toHtml">
                <
block type="adminhtml/template" name="content" template="login.phtml">
                    <
block type="core/text_list" name="form.additional.info" />
                </
block>
            </
block>
        </
adminhtml_index_login>

        <
adminhtml_index_forgotpassword>
            <
block type="core/text_list" name="root" output="toHtml">
                <
block type="adminhtml/template" name="content" template="forgotpassword.phtml">
                    <
block type="core/text_list" name="form.additional.info" />
                </
block>
            </
block>
        </
adminhtml_index_forgotpassword>

Then, you’ll need to clear you Magento’s cache and sessions. If you have SSH, you can do this by doing the following:

cd magento/var/sessions
rm 
-rf *
cd magento/var/cache
rm 
-rf *

This will destroy all current sessions and cache data. Your admin login page should work now.

 
Magento Community Magento Community
Magento Community
Magento Community
 
damir022
Jr. Member
 
Total Posts:  3
Joined:  2013-08-28
 

thx soo much you saved my day

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top