Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
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.Web.FormPostHandler.AddOrUpdateOrderLine(Int64 storeId, IDictionary`2 formFields, IDictionary`2 settings)
Any help on this one would be awesome!
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?
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.
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.
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.
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!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted