Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Dec 08, 2016 @ 15:09
    Alex Skrypnyk
    0

    Tea Commerce FormPost error

    Hi guys,

    We have strange problem with FormPost.aspx, we are using html API for working with order properties.

    An exception of type 'System.NullReferenceException' occurred in TeaCommerce.Api.dll but was not handled in user code
    

    Error from log:

    Tea Commerce FormPost error
     --- Form data:
     -- storeId = "1"
     -- returnUrl = "/cart/shippingpayment/"
     -- AddOrUpdateOrderProperties = "properties : properties"
     -- SetCurrentPaymentCountry = "countryId"
     -- SetCurrentShippingCountry = "countryId : shipCountry"
     -- SetCurrentPaymentCountryRegion = "countryRegionId : countryRegionId"
     -- SetCurrentShippingCountryRegion = "countryRegionId : countryRegionIdShipping"
     -- properties = "company : company, firstName : firstName, lastName : lastName, streetAddress : streetAddress, zipCode : zipCode, city : city, phone : phone, shipping_company : shipping_company, shipping_firstName : shipping_lastName, shipping_lastName : shipping_firstName, shipping_streetAddress : shipping_streetAddress, shipping_zipCode : shipping_zipCode, shipping_city : shipping_city, comments : comments, companyVATNo : companyVATNo"
     -- companyVATNo = ""
     -- company = "asdwerg"
     -- firstName = "safwerqg"
     -- lastName = "adefgr"
     -- streetAddress = "aeasgre"
     -- zipCode = "ewafgrh"
     -- city = "ewFGRE"
     -- countryId = "3"
     -- phone = "Q234"
     -- shipping_company = ""
     -- shipping_firstName = ""
     -- shipping_lastName = ""
     -- shipping_streetAddress = ""
     -- shipping_zipCode = ""
     -- shipping_city = ""
     -- countryIdShipping = "3"
     -- comments = ""
     - Exception: System.NullReferenceException: Object reference not set to an instance of an object.
       at TeaCommerce.Api.Models.CustomPropertyCollection.<>c__DisplayClass0_0.<Get>b__0(CustomProperty p)
       at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
       at TeaCommerce.Api.Models.CustomPropertyCollection.Get(String alias)
       at TeaCommerce.Api.Marketing.Models.Rules.PropertyRule.IsFulfilledBy(Order order)
       at TeaCommerce.Api.Marketing.Models.Rules.RuleGroup.<>c__DisplayClass9_0.<IsFulfilledBy>b__1(IOrderRule rule)
       at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
       at TeaCommerce.Api.Marketing.Models.Rules.RuleGroup.IsFulfilledBy(Order order, IEnumerable`1 previouslyFulfilledOrderLines)
       at TeaCommerce.Api.Marketing.Services.DiscountService.<>c__DisplayClass7_1.<ApplyDiscounts>b__1(RuleGroup ruleGroup)
       at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
       at TeaCommerce.Api.Marketing.Services.DiscountService.ApplyDiscounts(Order order)
       at TeaCommerce.Api.Models.Order.Save()
       at TeaCommerce.Api.Web.TeaCommerceHelper.AddOrUpdateOrderProperties(Int64 storeId, IDictionary`2 properties)
       at TeaCommerce.Api.Web.FormPostHandler.AddOrUpdateOrderProperties(Int64 storeId, IDictionary`2 formFields, IDictionary`2 settings)
       at TeaCommerce.Api.Web.FormPostHandler.FormPost()
    System.NullReferenceException: Object reference not set to an instance of an object.
       at TeaCommerce.Api.Models.CustomPropertyCollection.<>c__DisplayClass0_0.<Get>b__0(CustomProperty p)
       at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
       at TeaCommerce.Api.Models.CustomPropertyCollection.Get(String alias)
       at TeaCommerce.Api.Marketing.Models.Rules.PropertyRule.IsFulfilledBy(Order order)
       at TeaCommerce.Api.Marketing.Models.Rules.RuleGroup.<>c__DisplayClass9_0.<IsFulfilledBy>b__1(IOrderRule rule)
       at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
       at TeaCommerce.Api.Marketing.Models.Rules.RuleGroup.IsFulfilledBy(Order order, IEnumerable`1 previouslyFulfilledOrderLines)
       at TeaCommerce.Api.Marketing.Services.DiscountService.<>c__DisplayClass7_1.<ApplyDiscounts>b__1(RuleGroup ruleGroup)
       at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
       at TeaCommerce.Api.Marketing.Services.DiscountService.ApplyDiscounts(Order order)
       at TeaCommerce.Api.Models.Order.Save()
       at TeaCommerce.Api.Web.TeaCommerceHelper.AddOrUpdateOrderProperties(Int64 storeId, IDictionary`2 properties)
       at TeaCommerce.Api.Web.FormPostHandler.AddOrUpdateOrderProperties(Int64 storeId, IDictionary`2 formFields, IDictionary`2 settings)
       at TeaCommerce.Api.Web.FormPostHandler.FormPost()
    

    What it can be?

    Thanks,

    Alex

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Dec 08, 2016 @ 15:15
    Alex Skrypnyk
    0

    We have the same error even if just use html from HTML API example:

    <form method="post" action="/base/TC/FormPost.aspx">
      <input name="AddOrUpdateOrderProperties" value="properties" type="hidden" />
      <input name="storeId" value="1" type="hidden" />
      <input name="properties" value="firstName, lastName, email" type="hidden" />
      <input name="firstName" type="text" placeholder="First name" />
      <input name="lastName" type="text" placeholder="Last name" />
      <input name="email" type="text" placeholder="Email" />
      <input value="Update order properties" type="submit" />
    </form>
    

    So it looks like not a problem with html code.

    And data is saved after post, so it's really weird.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Dec 08, 2016 @ 15:16
    Alex Skrypnyk
    0

    It will be solution to you ajax sending, but I don't want to have crashes on the server.

  • Anders Burla 2560 posts 8256 karma points
    Dec 08, 2016 @ 20:54
    Anders Burla
    0

    Hi Alex

    It looks like a marketing rule that tries to get a property that is not there. Could you try and see if you have some marketing campaigns. If you do - try and disable them and see if you still have the same errors in your log.

    Kind regards

    Anders

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Dec 08, 2016 @ 22:35
    Alex Skrypnyk
    0

    Hi Anders,

    Thank you very much for your response.

    We have a lot of the same marketing campaigns, and all campaigns use only 'email' property. I can't disable all of them.

    So this is a problem with marketing campaigns do you think?

    Thanks,

    Alex

  • Anders Burla 2560 posts 8256 karma points
    Dec 09, 2016 @ 08:36
    Anders Burla
    0

    Yes it has something to do with campaigns, but can't tell what the exact error is. Have you updated to latest Tea Commerce and see if that fixes it? Always the first thing to to :)

    Kind regards

    Anders

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Dec 09, 2016 @ 08:56
    Alex Skrypnyk
    0

    We are using Tea Commerce 3.1.2 for Umbraco 7

    It should be easy yo update to 3.1.4.

    Thanks,

    Alex

  • Anders Burla 2560 posts 8256 karma points
    Dec 09, 2016 @ 09:06
    Anders Burla
    100

    Yes should be easy. Could you then try and disable one campaign at a time to see which one is generating the error. Then you have even more info.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Dec 09, 2016 @ 14:15
    Alex Skrypnyk
    0

    Thank you very much Anders, customers decided turn off all campaigns and it solved the issue.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Dec 09, 2016 @ 10:23
    Alex Skrypnyk
    0

    Anders, thank you very much for a help. We will do it after consultation with the customer.

    /Alex

  • Anders Burla 2560 posts 8256 karma points
    Dec 09, 2016 @ 14:17
    Anders Burla
    0

    Kind of super - but then again - if there is a bug it would be great to find it and solve it. So if you want to take a local copy and try and debug a bit more to get more info, that would be amazing.

Please Sign in or register to post replies

Write your reply to:

Draft