skywalkersoftwaredevelopment tutorial?

Topics: General
Jul 27, 2012 at 3:31 AM

Hi all, im just starting out with orchard and my teacher recommended the tutorial at:
http://skywalkersoftwaredevelopment.net/blog/writing-an-orchard-webshop-module-from-scratch-part-1


* can i use it with 1.5.1?
* I note section 8 onwards seems to have not been updated - will this affect the successfull completion using 1.5.1
* Are there any other similar tutorials out there?

Thank you for your suggestions, Kyd

Jul 27, 2012 at 6:13 AM

Hey Kyd - if you're following through from scratch [as I imagine you will be], I believe there is a mishap in section 7 where ShoppingCart and IShoppingCart are different to the source you can download. One of the methods needs to be made public [think it was Clear() from memory] and the AddRange() added etc. Also, the walkthrough version has 'productId' as a decimal when it should be an int in 'UpdateShoppingCartItemViewModel' -- If this doesn't make sense, download the source code for distinct differences. I didn't complete the tut as I was satisfied with where I was at, but you may get AntiForgery complications when logged in with the shopping cart, I believe the following will help you though:

http://stackoverflow.com/questions/9029402/orchard-cms-ajax-anti-forgery-token-when-logged-in

 ;)

If you complete the tut, could you double check my information and pass it on to Sipke [he is a forum member, board member, Yoda double here under the name of sfmskywalker] so he can update the tut. Other than this, I don't think 1.5.1 would make any difference, don't hold me to that though...maybe the module dependencies would need to change from Orchard.Projector to Orchard.Projections?...I'd just give it a shot and see.

Good luck with your quest; Orchard takes some getting use to, but well worth it. Cheers Dyr

Jul 28, 2012 at 4:33 AM

Hi Dyr, thanks for the reply, you were right and all your suggestions paid off. Though at the end of section 7 [this is with the downloaded source code] I get an error:

System.Web.Mvc.HttpAntiForgeryException was unhandled by user code
  Message=A required anti-forgery token was not supplied or was invalid.
  Source=System.Web.WebPages
  ErrorCode=-2147467259
  WebEventCode=0
  StackTrace:
       at System.Web.Helpers.AntiForgeryWorker.Validate(HttpContextBase context, String salt)
       at System.Web.Helpers.AntiForgery.Validate(HttpContextBase httpContext, String salt)
       at System.Web.Mvc.ValidateAntiForgeryTokenAttribute.OnAuthorization(AuthorizationContext filterContext)
       at Orchard.Mvc.AntiForgery.AntiForgeryAuthorizationFilter.OnAuthorization(AuthorizationContext filterContext) in E:\learn\src\Orchard\Mvc\AntiForgery\AntiForgeryAuthorizationFilter.cs:line 37
       at System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor)
       at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
  InnerException:

Do you know why this is? I gather it’s to do with the link you added in your post, but I’m not sure if I follow? Thanks for all your help til now. Kyd

Coordinator
Jul 28, 2012 at 12:49 PM

This may help: http://ryankeeter.com/ajax-and-anti-forgery-tokens-in-orchard-cms

Developer
Jul 29, 2012 at 2:25 PM

Although the tutorial is updated for 1.4, it should also work for 1.5. The primary breaking changes were the deprecation of RouteablePart and List.
Part 8 and the rest will be updated shortly.
Thanks for pointing out the errors, I will correct them asap.

Jul 31, 2012 at 1:06 AM

Fantastic, thanks for all your help Dyrgutt/bertrandLeroy, I managed to sort it using your examples as a reference.  Also, that's great to hear sfmskywalker, I have learnt a lot from your tutorial and can’t wait til you finish it to learn some more -- I really believe you’ve curbed the orchard learning curve for me, so cheers. Waiting anticipatively, thanks again - Kyd.