1

管理者用のテーマをインストールしました。キャッシュが更新され、見栄えが良くなりました。ログアウトして再度ログインすると、次のエラーが表示されました。

 Fatal error: Call to a member function getId() on a non-object in app/code/core/Mage/Adminhtml/Block/Page/Menu.php on line 80

65 ~ 89 行目:

public function getCacheLifetime()
{
    return 86400;
}

/**
 * Get Key pieces for caching block content
 *
 * @return array
 */
public function getCacheKeyInfo()
{
    $cacheKeyInfo = array(
        'admin_top_nav',
        $this->getActive(),
        Mage::getSingleton('admin/session')->getUser()->getId(),
        Mage::app()->getLocale()->getLocaleCode()
    );
    // Add additional key parameters if needed /
    $additionalCacheKeyInfo = $this->getAdditionalCacheKeyInfo();
    if (is_array($additionalCacheKeyInfo) && !empty($additionalCacheKeyInfo)) {
        $cacheKeyInfo = array_merge($cacheKeyInfo, $additionalCacheKeyInfo);
    }
    return $cacheKeyInfo;
}

この問題を解決するにはどうすればよいですか?

4

1 に答える 1

1

Mage::getSingleton('admin/session')->getUser()->getUserId()代わりに試してください。

于 2013-06-06T18:24:48.967 に答える