Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.5
-
None
Description
When creating a Personal Commerce Account via the dedicated method addPersonalCommerceAccount in CommerceAccountLocalServiceImpl, an exception is thrown by the subsequent method addCommerceAccount because there is no userId in serviceContext :
... public CommerceAccount addPersonalCommerceAccount( long userId, String taxId, String externalReferenceCode, ServiceContext serviceContext) throws PortalException { ...
... public CommerceAccount addCommerceAccount( String name, long parentCommerceAccountId, String email, String taxId, int type, boolean active, String externalReferenceCode, ServiceContext serviceContext) throws PortalException { // Commerce Account User user = userLocalService.getUser(serviceContext.getUserId()); ...
The userId should be set by the first method, using the passed parameter.