Copied to clipboard

Flag this post as spam?

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


  • overflew 87 posts 110 karma points
    Jul 12, 2010 @ 11:44
    overflew
    0

    Manipulating 'UpdateDate'

    Is it possible to manipulate the value of a content item's updateDate property?

    I'm performing a data migration of an older system, and want to maintain this property. I've tried setting it on the node, but the publish operation seems to override it. The code is approximately:

    Document d = Document.MakeNew([...]);
    d.UpdateDate = [...];
    d.Publish(DataMigrationUser);
    umbraco.library.UpdateDocumentCache(d.Id);

    Is the only other alternative to manipulate the database? Would modifying cmsDocument.updateDate & cmsContentVersion.VersionDate cover it?

     

  • overflew 87 posts 110 karma points
    Jul 12, 2010 @ 11:45
    overflew
    0

    (Sorry - the 'edit' button crashed) - Currently, it's always getting set as the date the .Publish() method is called

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jul 12, 2010 @ 12:16
    Aaron Powell
    0

    I'm pretty sure that UpdateDate is managed internally of the API. If you need a code-manageable date you should create a custom property on your document type, then you've got full control over it.

    If you don't want users to edit it then you could make it a label data type :)

  • overflew 87 posts 110 karma points
    Jul 30, 2010 @ 06:11
    overflew
    0

    Hmm, if I were to wish to muck around with it, for the purpose of a data migration, which DB tables would I have to meddle with?

    I assume:

    • cmsDocument
    • cmsContentXml
    • cmsContentVersion
    I'll try report on how I get on...

Please Sign in or register to post replies

Write your reply to:

Draft