cancel
Showing results for 
Search instead for 
Did you mean: 

REST throws error 500 at product creation.

REST throws error 500 at product creation.

I'm setting up REST connection to my Magento store but I run into trouble with product creation. 

GET works like it should, so does POST, except for products. I cannot update any products nor create any new products. 

If I try to do this I get an error 500 without additional information. 

 

The Magento installation I have is created by freelancers on Freelancer.com.

I have installed a blank installation of Magento on the same server, and did some diff checks to see what they had altered. 

Appearently they edited some core files Smiley Surprised, which I know is the worst way to edit magento. 

 

But they have not edited any files in the Api / Api2 folders, so I do not think they screwed up there.

 

Does anybody know where I should continue my search for the problem. Which files / database structure does magento need to be able to process REST connections? Is it only the Api / Api2 folders, or should I check in other places?

 

4 REPLIES 4

Re: REST throws error 500 at product creation.

Did you check your webservers log files? For Apache, they could be in /var/log/apache2 on your server. The error should show up there.

Re: REST throws error 500 at product creation.

No, actualy I didn't.

 

In the apache error log I get this error:

Call to a member function getId() on a non-object in /home/robodd/domains/robodd.nl/public_html/besnel/app/code/core/Mage/Catalog/Model/Observer.php on line 67

I will continue my search.

Re: REST throws error 500 at product creation.

After some checking I can confirm the culprit is the extension I expected.

 

It has calls like this:  Mage::getSingleton('admin/session')->getUser()->getId(); 

Which I assume are not compatible with REST connections, since there is not a real admin/session active.

 

Does someone have an idea on how to solve this problem? Is there a getSingleton('REST/session') alternative or something?

 

 

Re: REST throws error 500 at product creation.

what is the RESt request and URL format you used for creating the product ?