Vinai/customer-activation

Customers Not Activated through OTB Magento API

Opened this issue · 4 comments

Hi,

We are using this extension on a Magento Enterprise 1.14 installation and noticed an issue where when this extension is enabled, the magento API customerCustomerCreate does not work correctly. If we try to created a customer using this API, the customer is still shown as not activated even though it is set as activated in the API request.

This problem does not occur when this extension is disabled.

Please advice.

Regards,
Robert.

Thanks for the issue. How do you set the customer as active during the customerCustomerCreate resource call?

Hi,

In the XML request there is an attribute named ‘customer_activated’. This attribute is set to 1 as blow example.

<customer_activated>1</customer_activated>

After performing some analysis I noticed that method customerSaveBefore() in observer.php is resetting the customer activate attribute to 0.

Well, the method _isApiRequest should catch the request and should stop the observer from doing so.
A quick test on my local instance shows it works fine.
For further debugging, if you change to _isApiRequest method as follows, what does var/log/debug.log show after you create a customer using the API?

protected function _isApiRequest()
{
    Mage::log(Mage::app()->getRequest()->getModuleName(), Zend_Log::DEBUG, 'debug.log', true);
    return Mage::app()->getRequest()->getModuleName() === 'api';
}

Hi,

I will have to check this tomorrow as I am done for the day.

Will keep you posted.

Thanks.