1
votes

Whenever I try to do something in a popup window, live export or preview a transactioanl email I get an error:

Fatal error: Call to a member function addLink() on a non-object in /home/jsrdirec/public_html/app/code/core/Mage/Adminhtml/Block/Widget.php on line 65

Here is app/code/core/Mage/Adminhtml/Block/Widget.php:

  protected function _addBreadcrumb($label, $title=null, $link=null)
{
    $this->getLayout()->getBlock('breadcrumbs')->addLink($label, $title, $link);
}

Does anyone have any idea what could be causing this?

2

2 Answers

1
votes

There can be so many reasons for this , check this question for more information. Mean while you can try this hack to fix your problem.

1
votes

I had this same problem. I noticed it when I was trying to import products through the import interface. The kicker was that two days before the problem started, everything was working fine. My solution, as a temporary fix, was I edited the _addBreadCrumb function in app/code/core/Mage/Adminhtml/Block/Widget.php to be

protected function _addBreadcrumb($label, $title=null, $link=null)
{
    if($this->getLayout()->getBlock('breadcrumbs')){
        $this->getLayout()->getBlock('breadcrumbs')->addLink($label, $title, $link);
    }
}

For me, I didn't care if there were breadcrumbs on the admin page, specifically when importing products or sending emails. So far, it hasn't caused a problem on the store site itself. Breadcrumbs are still generating as expected, I can still add to cart, checkout, etc.

PLEASE NOTE - This is changing a core class in a core class file, which is not the best/borderline bad if not bad. So I want to emphasize this is/should be a TEMPORARY fix only!!