bleroy / Nwazet.Commerce

Idiomatic commerce module for Orchard CMS.
BSD 3-Clause "New" or "Revised" License
26 stars 21 forks source link

ArgumentNullException in WishLists #138

Closed MatteoPiovanelli-Laser closed 6 years ago

MatteoPiovanelli-Laser commented 6 years ago

ProductPartWishListDriver.Display calls _wishListsUIServices.CreateShape(user, part) even when the user is null. THe idea is that there should be an "Add to list" link even for non-authenticated users, even if wishlists require an authenticated user. The implementation of CreateShape throws ArgumentNullException on user==null. This should probably be change to avoid filling up the logs with errors when this is really a normal situation

bleroy commented 6 years ago

It should probably have some configurable behavior, the default being to redirect you to authentication/account creation. Other options could be to redirect somewhere, or to create some form of list in client storage... Now that could be costly, but on the other hand, I thought that was somehow the plan all along. Maybe I got that wrong, but would that make sense?

MatteoPiovanelli-Laser commented 6 years ago

I think that was the point of having the IWishListsUIServices separate, yes. That way one would only have to write the two methods for those shapes to do the different things. I think throwing this exception is a leftover from initially trying to use these methods for something else.

MatteoPiovanelli-Laser commented 6 years ago

Also IWishListExtensionProvider is there for further customizations