bleroy / Nwazet.Commerce

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

Specified cast is not valid exception #18

Closed bleroy closed 8 years ago

bleroy commented 11 years ago

Originally reported by: Robert Greyling (Bitbucket: RobertTheGrey, GitHub: RobertTheGrey)


I have products that include the product part in their definition (so I never use the raw Product content type) and in v1.6 it worked fine, but now in Orchard 1.7.1, every time I add an item to the cart I get the following exception:

Specified cast is not valid.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

See attachment

I have tried running the site from v1.7.1 source in VS and debugged (break on all exceptions) and it never hits the code. Even though the exception looks like it's related to MVC, I can't get it to break into any of the Nwazet Controllers or Drivers before this exception occurs, so I can't see the cause.

As I said, this was working 1.6 just fine for other projects - this is not an upgrade, but a clean 1.7.1 project from scratch. Any help tracking this down is much appreciated.


bleroy commented 11 years ago

Original comment by Bertrand Le Roy (Bitbucket: bleroy, GitHub: bleroy):


Fixed in 6ae83caa80154a9a3755d5a1807ba840e267dcbb

bleroy commented 11 years ago

Original comment by Robert Greyling (Bitbucket: RobertTheGrey, GitHub: RobertTheGrey):


Downgraded to minor since it has a workaround

bleroy commented 11 years ago

Original comment by Robert Greyling (Bitbucket: RobertTheGrey, GitHub: RobertTheGrey):


Ok, I think I found the cause. I had the Product Attributes module turned off because I didn't want customers to customize any products. When I turned the module on then it adds to the cart just fine. So in effect, we are forced to have that module turned on, which is fine if required, but perhaps it should be listed as a dependency on the main Commerce module?

bleroy commented 11 years ago

Original comment by Robert Greyling (Bitbucket: RobertTheGrey, GitHub: RobertTheGrey):


Could this be related to the MVC3 -> MVC4 issue? http://aspnetwebstack.codeplex.com/workitem/373

bleroy commented 11 years ago

Original comment by Robert Greyling (Bitbucket: RobertTheGrey, GitHub: RobertTheGrey):


Attachment rather than inline exception

bleroy commented 11 years ago

Original comment by Robert Greyling (Bitbucket: RobertTheGrey, GitHub: RobertTheGrey):


Better a picture as the text is hard to read due to formatting