I am using module (in Magento 1.9.3.10) that extends the default Mage/Product model by adding a new attribute named Status with a corresponding file named Status.php residing in Package\ModuleName\Model\Catalog\Product\Attribute.
The Status attribute also extends Mage_Eav_Model_Entity_Attribute_Source_Abstract.
If I try to access the REST API for products on either my development and production servers (with the required OAuth parameters), i.e http://localhost/magento/api/rest/products causes a 500 internal error whiles every other rest endpoint do not fail.
How can I include the custom attribute in the REST API without causing 500 internal errors?
NB: I am using an OAuth consumer which has been verified and I am able to fetch products IFF the custom module is uninstalled
-
you need to pass admin tokenAditya Shah– Aditya Shah2018年10月20日 19:37:12 +00:00Commented Oct 20, 2018 at 19:37
-
Please read the NB I have appendedtejkweku– tejkweku2018年10月21日 21:55:05 +00:00Commented Oct 21, 2018 at 21:55
1 Answer 1
I was able to find the cause of the problem. An observer was set on catalog_product_collection_load_before.
It called a function that tries to access the the details of the user through Mage::getSingleton('admin/session')->getUser(). Unfortunately, this returns null when it is a REST call.
Explore related questions
See similar questions with these tags.