Error when modifying product catalog sample module

Posted by Community Admin on 05-Aug-2018 09:38

Error when modifying product catalog sample module

All Replies

Posted by Community Admin on 13-Apr-2011 00:00

hi, currently i'm modifying product catalog module, i'm removing quantity, price and whatisinthebox field.
things run smoothly until i try to add new product and publish it. it throw js error "There was an error deserializing the object of type Telerik.Sitefinity.Web.Services.ContentItemContext`1[[MyNameSpace.Model.ProductItem, MyNameSpace, Version=1.0.4120.29178, Culture=neutral, PublicKeyToken=null]]. The value '' cannot be parsed as the type 'Int64'."

here's the json parameter that being sent

"Item":"AllowComments":"false","AllowTrackBacks":null,"ApproveComments":false,"AvailableLanguages":[],"DateCreated":"\/Date(1302683015531)\/","DefaultPageId":null,"Description":"Value":"","EmailAuthor":false,"ExpirationDate":null,"LastModifiedBy":"00000000-0000-0000-0000-000000000000","OriginalContentId":"00000000-0000-0000-0000-000000000000","Owner":"61a3f37d-fbae-42b6-9b66-090b0518fc6e","PostRights":1,"PublicationDate":"\/Date(1302683025279)\/","Status":["1f5435a0-b4fc-4336-b32a-2549b1d5f552"],"Title":"Value":"product 1","UIStatus":0,"UrlName":"Value":"product-1","Version":0,"ViewsCount":0,"Visible":false,"VotesCount":0,"VotesSum":0,"ApprovalWorkflowState":"Value":"","Content":"Value":"description","Parent":null,"Category":[],"Tags":[],"LastModified":"\/Date(1302683101983)\/"

any input why this error happen?

Posted by Community Admin on 13-Apr-2011 00:00

I am also getting an error when modifying the product catalog sample.  I removed the same three fields, and added one new field (Product ID).  I also removed the "Colors" taxonomy from the ProductsDefinition.cs file.

The files I changed were:
Model/ProductItem.cs
Web/UI/Public/ProductsDefinitions.cs
Web/Services/Data/ProductItemViewModel.cs
Data/ProductsManager.cs

The list view loads successfully, but when I try to add a new product using FireFox and click on Publish I get a javascript alert box that says "Return Code: 0".  In IE, the AJAX loaded just spins and I never get an error.  When I tried debugging this using Fiddler, I instead got an alert box that said "Undefined".

Posted by Community Admin on 21-Apr-2011 00:00

Hi Chris,

Can you check if one of these fields has left in the ProductsManager.cs and its method Copy() ? If yes, you should delete it there too. Also, please make sure that the new fields are Lstrings.

You can also try to update to the new versions of the modules. After you've upgraded Sitefinity to 4.1, you can follow the these steps below to upgrade the custom modules.

  1. Add the new OA mappings to the module, following the steps from this blog post www.sitefinity.com/.../changes_in_mapping_persistent_classes_in_custom_modules_with_sitefinity_4_1.aspx

  2. Enhance the module project by putting a reference to its csproj file , which looks like this,
    Copy Code
    <PropertyGroup>
      <OpenAccessPath>C:\tfs\SitefinityProject\Sitefinity 4.0\OfficialSDK\Content\Common\Dependencies\</OpenAccessPath>
    </PropertyGroup>
    <Import Condition="Exists('$(OpenAccessPath)\OpenAccess.targets')" Project="$(OpenAccessPath)\OpenAccess.targets" />

The lines above should be placed right before </Project> closing tag.

The path colored in yellow should be your own path to the Dependencies folder (with your 4.1 project files will be in Reference Assemblies\Telerik\OpenAccess.

All the best,
George
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

This thread is closed