0

Everything was fine 'til this morning. I've tried clearing cache, re indexing, all tips I could find on the internet. Here is the message I'm getting Fatal error: Call to a member function getId() on a non-object in /home5/rockbott/public_html/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php on line 578

here is line 577 and 578:

   if (Mage::app()->isSingleStoreMode()) {
        $product->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId()));

A newly created product gives me Fatal Error message. Duplicated product gives me the same, but when I go to manage products it appears, but without SKU# and 0 stock count. When I try to edit that product again - I get Fatal Error. Please help me with my problem.

Thanks in advance.


Thanks for your response. Someone suggested that I clear log file and I did. I'm sorry I don't have the log file. Compiler is disabled as well. Would you be kind enough to take a look here: http://www.magentocommerce.com/boards/viewthread/347764/ I've posted more information there including reports. Thank you Anna

4

4 回答 4

1

我意识到这很旧,但是在安装 Magento 1.9.0.1 时我遇到了同样的问题。我不确定发生了什么,但启用缓存允许它为我工作。诡异的。

于 2014-09-16T23:36:38.213 回答
1

在我的情况下,导致它的原因似乎是Mage.php我用来跟踪事件的剩余日志记录行。

在第 447 行,我有:

Mage::log($name, null, 'events.log');

删除此日志记录行解决了该问题。

于 2015-06-03T19:15:21.243 回答
0

用你的信息很难找到问题所在。您可以粘贴您的 system.log 文件吗?

一个问题:您是否启用了编译器?尝试禁用它。

于 2013-04-20T12:59:57.027 回答
-1

我有同样的错误。解决方案非常简单:您需要将getStore(true)替换为getStore(1)。这很奇怪,因为在 PHP 中与 1相同……但在这方面是一个错误。如果您做出“更正确”并写下:

$product->setWebsiteIds(array(Mage::app()->getStore(Mage::app()->getStore()->getId())->getWebsite()->getId()));

Magento 给你的不是真实的网站。懒得找了,还有程序员 Magento (getStore (true)) :)) 所以我决定离开它

于 2015-01-26T08:37:22.437 回答