Copied to clipboard

Flag this post as spam?

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


  • Web Project 24 posts 174 karma points
    Feb 05, 2020 @ 09:51
    Web Project
    0

    Error while importing data for property '', datasource record

    Hi, thank for the plugin. I tried to import Standard Page Blog Post from csv file and plugin returns me thi error Error while importing data for property '', datasource record

    This is log file

    2020-02-05 10:36:47,945 [P716/D26/T9] ERROR CMSImportLibrary.Providers.ImportProviders.Content.ContentImportProvider - CMSImport:A record failed to import for alias System.NullReferenceException: Object reference not set to an instance of an object. at USN.USNBusinessLogic.USNRegisterEvents.ContentService_Saving(IContentService sender, SaveEventArgs1 e) in C:\inetpub\wwwroot\sitename\src\Umbraco.Web.UI\App_Code\USNBusinessLogic\USNRegisterEvents.cs:line 163 at Umbraco.Core.Events.ScopeEventDispatcherBase.DispatchCancelable[TSender,TArgs](TypedEventHandler2 eventHandler, TSender sender, TArgs args, String eventName) in \server\wwwroot\sitename\src\Umbraco.Core\Events\ScopeEventDispatcherBase.cs:line 53 at Umbraco.Core.Services.ContentService.Save(IContent content, Boolean changeState, Int32 userId, Boolean raiseEvents) in \server\wwwroot\sitename\src\Umbraco.Core\Services\ContentService.cs:line 2611 at Umbraco.Core.Services.ContentService.Umbraco.Core.Services.IContentServiceOperations.Save(IContent content, Int32 userId, Boolean raiseEvents) in \server\wwwroot\sitename\src\Umbraco.Core\Services\ContentService.cs:line 1529 at Umbraco.Core.Services.ContentService.Save(IContent content, Int32 userId, Boolean raiseEvents) in \server\wwwroot\sitename\src\Umbraco.Core\Services\ContentService.cs:line 1387 at CMSImportLibrary.Providers.ImportProviders.Content.ContentImportProvider.(ImportState , Int32 , ImportStatistics , String )

    Best regards

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Feb 05, 2020 @ 11:09
    Richard Soeteman
    1

    Hi,

    The error is coming from your Save event in your USNRegisterEvents, maybe fix it there?

    Best,

    Richard

  • Web Project 24 posts 174 karma points
    Feb 05, 2020 @ 11:26
    Web Project
    0

    Hi Richard, thank you for reply. If i insert a new post i haven't problem. Can you help me to find error?

    thank you

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Feb 05, 2020 @ 11:29
    Richard Soeteman
    1

    You should add a Breakpoint in that class and run the import to see what is happening, Maybe you are missing a property?

    Best,

    Richard

  • Web Project 24 posts 174 karma points
    Feb 05, 2020 @ 17:36
    Web Project
    0

    Hi, Richard thank you

    the error is in USNRegisterEvents.cs line 163

    DateTime newsItemDate = DateTime.Parse(node.GetValue("postDate").ToString());

    System.NullReferenceException: 'Reference to an object not set on an object instance.'

    Umbraco.Core.Models.IContentBase.GetValue(...) returned null.

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Feb 06, 2020 @ 07:38
    Richard Soeteman
    1

    Ok so you can fix it there.

  • Web Project 24 posts 174 karma points
    Feb 06, 2020 @ 08:57
    Web Project
    0

    If i set newsItemDate with this manually value DateTime newsItemDate = DateTime.Parse("01/01/2000"); plugin executes the import without errors, but obviously create the folder "2000" and "January". If i want import post in correctly folder date, which node.GetValue parameter should I use?

  • Web Project 24 posts 174 karma points
    Feb 11, 2020 @ 09:51
    Web Project
    100

    Hi all, finally i solved problem. I changed USNRegisterEvents.cs line 163

    DateTime newsItemDate = DateTime.Parse(node.CreateDate.ToString());

    Thank you all

Please Sign in or register to post replies

Write your reply to:

Draft