Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-7427

Document creation date not correct

    XMLWordPrintable

Details

    • creationDate
    • Medium
    • N/A
    • N/A

    Description

      All (at least almost all) the creation dates are wrong. They are set to the first occurrence of getDocument() for a specific document and not on first save(). Usually the difference ist only small (minutes), but there are cases where the difference are several days.
      We suppose that calling getDocument('Test.NotExistingDoc') creates the document and puts it into the cache with a current timestamp in creation date. Let's say you work now for an hour before you save the document, then the creation date would be an hour old even though the document has just been created.
      We always expected the creation date to be the moment of the first save. Thus we think it's a bug. We came across the problem because we had someone complaining that a document he created on the 19th was listed under the ones from the 17th. This could even happen across users if e.g. there is a link to a not yet existing page. User A clicks on the link, realizes there is nothing on the page and leaves. Hours later user B goes to the page and adds content. Now the creation date of the page would be at an inexplicable time for user B since he never touched the document until hours after the shown creation date.

      We work on 2.7.2 at the moment. After asking on the mailing list Marius Dumitru Florea was able to "reproduce on 3.4RC1".
      To reproduce it create the following script:

      #set($newDoc = $xwiki.getDocument('Test.NotExistingDoc'))
      $newDoc.getCreationDate()
      

      If you reload several times you see, that the creation date does not change, even though the document has never been saved. Add a save to the script:

      $newDoc.save()
      

      Now you have a document where creation date and save date of the version 1.1 do not match.

      Attachments

        Activity

          People

            jvdrean Jean-Vincent Drean
            ebeutler Edoardo Beutler
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: