Roshni
Roshni

Reputation: 325

unable to open product from Magento Backend, It is showing fatal error

Error:

Fatal error: Call to a member function getConfig() on a non-object in \app\code\core\Mage\Adminhtml\Block\Catalog\Product\Helper\Form\Gallery\Content.php on line 50

Fatal Error on product page in frontend:

Fatal error: Call to a member function getMediaUrl() on a non-object in \app\code\core\Mage\Catalog\Model\Product.php on line 1018

Upvotes: 2

Views: 1106

Answers (3)

Vladimir Despotovic
Vladimir Despotovic

Reputation: 3498

This is one suggestion on what you should check. Follow these steps:

1.Check your version of Magento (for example, go to admin, scroll to the bottom ad see the version number).
2.Find this Magento version on the web and download it.
3.Copy over the app/code/core directory, overwrite the existing directory.
4.If you pulled file system from git, then don't overwrite anything while you are working on the steps one through three
5.Try again to access the product.

Which Magento version are you using, which PHP version? Which Operating System?

Upvotes: 0

user4153980
user4153980

Reputation:

Error Call to a member function getConfig() on a non-object in \app\code\core\Mage\Adminhtml\Block\Catalog\Product\Helper\Form\Gallery\Content.php on line 50 is caused by missing file Uploader.php located at

app/code/core/Mage/Adminhtml/Block/Media/ in most cases.

For example, if you migrate from one host to another this file may be lost

due to restrictions in access rights, I mean reading this file is not allowed for everyone. It allowed only for owner of the file and members of the group of owner.

Upvotes: 0

Russell Albin
Russell Albin

Reputation: 51

I really bet your issue is in your .gitignore. I recently had the same issue, and it was because my .gitignore had media/ as one of the entries. Well, go figure, that burried deep in the core inside Adminhtml is this path: app/code/core/Mage/Adminhtml/Block/Media/ That gitignore was excluding that folder NOT just the main media folder in the root of the Magento installation. Check your code base, I imagine that the folder is missing in your remote server. Once you update your .gitignore that should be added and of course once you commit your code and pull it on the remote server, things will work as expected. I changed my gitingore to be more specific here is the parts with the media folders media/catalog/ media/customer/ media/dhl/ media/xmlconnect/

Upvotes: 3

Related Questions