Developer forum

Forum » Integration » error with special chars in ProductID

error with special chars in ProductID

Kenneth Radoor
Reply

Hi

We are importing a lot of products to ecom, and setting the ProductID in the import.

Some of the IDs contain special characters, like æ,ø or å

This is ok in the import and i guess(know) the database is ok with it too.

We do get an error when ever we try to edit the product in ecom.

[SqlException (0x80131904): Violation of PRIMARY KEY constraint 'EcomProducts$PrimaryKey'. Cannot insert duplicate key in object 'dbo.EcomProducts'.
The statement has been terminated.]
   System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount) +1501179
   System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount) +45
   System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping) +2475
   System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping) +41
   System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable) +170
   System.Data.Common.DbDataAdapter.Update(DataSet dataSet) +12
   Dynamicweb.eCommerce.Products.Product.SaveAndConfirm(String ProductID, String ProductVariantID, String ProductLanguageID, Boolean skipExtendedSave) +2747
   Dynamicweb.eCommerce.Products.Product.SaveAndConfirm(String ProductID, String ProductVariantID, String ProductLanguageID) +23
   Dynamicweb.Admin.eComBackend.ProductEdit.SaveProduct(Product prod, String prodId, String groupId, String variantId, Boolean VariantProduct, Boolean WizardProduct, String redirUrl, Boolean closeAfterSave) +2896
   Dynamicweb.Admin.eComBackend.ProductEdit.SaveAndCloseProduct_Click(Object sender, EventArgs e) +246
   Dynamicweb.Controls.RibbonBarButton.RaisePostBackEvent(String eventArgument) +33
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9664998
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

 

My best guess is that the productID gets urlencoded and that encoding is not reversed before the product is tried being saved to the database.

I had hoped that i could make a little magic in the import via some C#-script in a xslt script, but  "Execution of scripts was prohibited"

Is it posible to fix it so that DW can have non-ancii chars in the ProductID, or is it by design that its not posible ?

 

/Kenneth 


Replies

 
Nicolai Høeg Pedersen
Reply

I'm not sure this is because of non-ascii characters. This is a duplicate key problem, meaning you have the same combination of productid, languageid and variantid more than once.

So check for duplicates in your table - the contraint is disabled when importing, that is why you do not see it until you save.

 
Kenneth Radoor
Reply

Hi

True there was 2 products with the same Id, or almost the same id, 310100GRÅ and 310100GR�.

I deleted the lattet in the database, checked in ecom by opening the former product and saved it.

By saving it i get the error above, and looking in the database we had the 2 products again: 310100GRÅ and 310100GR�

We do not have any dublicates in the import and the problem is only there with all the pruducts with none ascii chars in the ID

/Kenneth

 
Kenneth Radoor
Reply

Deleted because it was a dupliate of the above sad 

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Hi Kenneth

Yes, that seems to be a encoding, js something error.

But, we do officially only support IDs with boring a-z0-9. Will take a better look at the issue and get back though.

Votes for this answer: 1

 

You must be logged in to post in the forum