Copied to clipboard

Flag this post as spam?

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


  • Jeremy Hillman 4 posts 24 karma points
    Dec 13, 2011 @ 14:47
    Jeremy Hillman
    0

    Date not importing into document type specific date field

    Hi Richard

    I'm importing some content from the SQL Server 2005 database of our old proprietary CMS.

    One of our Umbraco document types has a document property of type "Date picker with time", which I've mapped to a date field in the old DB, but no value appears.  If, in the same import run, I also map the generic Create Date field to the same field in the old DB, its value gets populated no problem.

    I've tried modifying the stored procedure in the old DB to output the date as a varchar (YYYY-MM-dd hh:mm:ss) rather than a datetime, and specified the same date format in the advanced settings, but the same thing happens: no value appears in the custom field, but it does import into the generic Create Date field.

    Do you have any ideas / am I missing something obvious?

    Many thanks,

    Jeremy

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Dec 13, 2011 @ 15:54
    Richard Soeteman
    0

    Hi Jeremy,

    I get the correct values when importing from sqlserver (sorry don't have 2005). Sure the mapped value isn't null?

    Cheers,

    Richard

  • Jeremy Hillman 4 posts 24 karma points
    Dec 13, 2011 @ 19:00
    Jeremy Hillman
    0

    Thanks Richard.  In fact, I think we have a bit of a freak problem with the name of our custom field (Publish date), which seems to be conflicting with the generic Publish at field.  I've renamed the field and it now imports correctly.

    Thanks again

    Jeremy

     

  • Gijs van Dam 2 posts 22 karma points
    May 20, 2012 @ 20:47
    Gijs van Dam
    0

    Hi, Richard and Jeremy.

    I can confirm this behaviour. Things go haywire if you have a field in your document type called Publish Date. If you change the name of the field, everything works as expected.

    It has to do with the fact that there already is a native field Publish Date. It would be nice though if CMSImport would play nice with this situation where there's another field with the same name.

     

    Regards!

  • Richard Soeteman 4035 posts 12842 karma points MVP
    May 21, 2012 @ 08:46
    Richard Soeteman
    0

    Hi Guys,

    Yes sorry CMSImport has a few harde coded properties that it uses for the normal fixed content porperties. It's my mistake for not having prefixes when I created the first release in 2008. The prroperties are: 

    • nodeName
    • publishDate
    • expireDate
    • createDate
    It's not possible to prefix those now since that will mess up existing import definitions. I've created a workitem for the next release that shows a warning in case your document type contains a dynamic property that conflicts with the fixed ones.
    Best,
    Richard
  • Gijs 38 posts 133 karma points
    May 22, 2012 @ 09:26
    Gijs
    0

    Tricky issue. Thank you for the explanantion. Would it be possible to update all the existing import definitions in some sort of batch operation?

    Although I just renamed the property. That worked too.

  • Richard Soeteman 4035 posts 12842 karma points MVP
    May 22, 2012 @ 09:36
    Richard Soeteman
    0

    Hi Gijs,

    Yes that would be possible but that can go wrong and in case of scheduled imports people might figure that out after weeks of not importing stuff, so I think I stick with the warning...

    For the Umbraco V5 version that I'm building from scratch those aliasses get's replaced with a more specific alias.

    Best,

    Richard

  • Ekta Dahiya 3 posts 23 karma points
    Jul 17, 2012 @ 15:54
    Ekta Dahiya
    0

    Hi there

    I have defined a CMS import task and when i run it manually it works fine with no error and copies data from one database to another successfully.

    If I run the same task as a Scheduled task, the Task runs but throws an error :

    Errors:Error while importing data for property '' :Object reference not set to an instance of an object.

    The error doesnt show name of a property where it fails so its hard to debug. Also as the task otherwise runs fine, not sure why it fails as a scheduled task.

    E

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Jul 17, 2012 @ 15:59
    Richard Soeteman
    0

    Hi,

    This should not happen. I think this is because the locale settings of you when logging in and the user who imports the data are different.What you can do is open the advanced settings of the date field (green icon) where you map the property against and make sure the format is exactly the same as the format of the datasource. Then CMSImport will use that format string to import the data and ignore locale settings etc.

    Cheers,

    Richard

  • Ekta Dahiya 3 posts 23 karma points
    Jul 17, 2012 @ 16:10
    Ekta Dahiya
    0

     

    Thanks for a quick reply. I am logged onto Umbraco with Admin login and the scheduled task runs under the same login.

     

     

     

    When I run the Import Definition logged in as an Admin, it works fine. As I said the error is when run the same definition under scheduled task. There  have a notification email which looks like below -

     

     

     

    This is an automated mail to inform you that the task Hourly Consultant Update executed

     

    Statistics:

     

    1089 records in datasource

     

    0 records added

     

    0 records updated

     

    1088 records skipped

     

    2 errors during import

     

    Errors:Error while importing data for property '' :Object reference not set to an instance of an object.

     

     

     

     

     

    No fields on the Import definition are of type DATE.

     

     

     

    E

     

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Jul 17, 2012 @ 16:14
    Richard Soeteman
    0

    That is weird, should not be of any difference. Can you check the UmbracoLog table for the detail of this exception?

    Thanks,

    Richard

  • Ekta Dahiya 3 posts 23 karma points
    Jul 17, 2012 @ 16:16
    Ekta Dahiya
    0

    CMSImport: A record failed to import for alias error:System.NullReferenceException: Object reference not set to an instance of an object.     at umbraco.cms.businesslogic.member.Member.MakeNew(String Name, String LoginName, String Email, MemberType mbt, User u)     at umbraco.cms.businesslogic.member.Member.MakeNew(String Name, MemberType mbt, User u)     at CMSImportLibrary.Import.MemberImporter.ImportMembers(ImportState state, User importAsUser, String datasourceFile)

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Jul 17, 2012 @ 16:25
    Richard Soeteman
    0

    Ah I was under assumption that you used date format because this thread was about date issues. Are you absolutly sure you are importing the same datasource? This is a message about Umbraco that can't create a new member. I have the assumption the loginname is empty.

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Dec 19, 2012 @ 13:23
    Richard Soeteman
    0

    @Gijs,

    You can use Publish Date proerties again. I've just fixed this in the 2.3 release of CMSImport

    http://our.umbraco.org/projects/developer-tools/cmsimport/

    Cheers,

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft