Copied to clipboard

Flag this post as spam?

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


  • David Mill 15 posts 85 karma points
    Oct 01, 2018 @ 10:01
    David Mill
    0

    Form Post Error From Campaign

    I recently run into an issue with a campaign which is required for the website we are building for a client.

    I am using Umbraco v7.11.1 and MySQL as the database

    The error is only when the campaign is active and when the parameters are met for the campaign.

        2018-10-01 10:54:34,861 [P548/D2/T11] ERROR TeaCommerce.Api.Web.FormPostHandler - FormPost error
    -- Form data:
     -- storeId = "1"
     -- AddOrUpdateOrderLine = "orderLineId : orderLineId, quantity : quantity, overwriteQuantity : overwriteQuantity"
     -- overwriteQuantity = "true"
     -- orderLineId = "76"
     -- quantity = "49"
    
    MySql.Data.MySqlClient.MySqlException (0x80004005): Field 'CampaignId' doesn't have a default value
       at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
       at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
       at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
       at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
       at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
       at MySql.Data.MySqlClient.MySqlCommand.ExecuteScalar()
       at TeaCommerce.Api.Persistence.Database.Insert(String tableName, String primaryKeyName, Boolean autoIncrement, Object poco)
       at TeaCommerce.Api.Persistence.Database.Insert(Object poco)
       at TeaCommerce.Api.Persistence.Repositories.OrderRepository.SaveDiscounts(Database database, DiscountCollection discounts, DiscountType discountType, Guid orderId, Nullable`1 orderLineId)
       at TeaCommerce.Api.Persistence.Repositories.OrderRepository.Save(Order order)
       at TeaCommerce.Api.Models.Order.Save()
       at TeaCommerce.Api.Web.FormPostHandler.AddOrUpdateOrderLine(Int64 storeId, IDictionary`2 formFields, IDictionary`2 settings)
       at TeaCommerce.Api.Web.FormPostHandler.FormPost()
    

    Image of the error for easier readability.

    Any help on this one would be awesome!

    David

  • Rune Grønkjær 1303 posts 2895 karma points
    Oct 02, 2018 @ 07:56
    Rune Grønkjær
    0

    Hi David

    Does this happen to all kinds of campaigns or just specific ones? Try making one or more simple examples and see if the same error occurs. Do you see a pattern?

    /Rune

  • David Mill 15 posts 85 karma points
    Oct 02, 2018 @ 08:13
    David Mill
    0

    Hi Rune,

    Appreciate the response.

    I have tried it with another couple of test awards and they all return the 500 Error with the same reasons within the Umbraco trace log.

    Thanks,

    David

  • Rune Grønkjær 1303 posts 2895 karma points
    Oct 02, 2018 @ 14:02
    Rune Grønkjær
    1

    Hi David,

    I found a bug in the MySql install sql script. We are adding a CampaignId column to the TeaCommerce_Discount table. Just remove that column and it should be working.

    /Rune

  • David Mill 15 posts 85 karma points
    Oct 02, 2018 @ 14:53
    David Mill
    0

    Hi Rune,

    I have deleted the CampaignId column and it returned another error.

    This time it was the AwardAlias column not having a default value, so after removing that and then the Settings column had the same issue.

    For the campaign I have which is basically just a free delivery when sub-total is over X amount, it works a treat now. However, what impact does the removal of these 2 other columns? I'm not wanting to break any functionality of the awards on the campaigns.

    /David

  • Rune Grønkjær 1303 posts 2895 karma points
    Oct 03, 2018 @ 06:56
    Rune Grønkjær
    1

    Hi David,

    You are right. Those two can be deleted from the TeaCommerce_Discount table as well. Looks much like a copy paste error in the sql install scripts.

    Thanks for your error report!

    /Rune

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies