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

The contentUpdateDate is updated even if there has been nothing changed on the document

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Major
    • None
    • 1.5.2, 1.6.1, 1.7 M1
    • Model

    Description

      The contentUpdateDate / contentDirty implementation is completely wrong.
      For example, try the following in a document :

      #set($sdoc=$xwiki.getDocument("Sandbox.WebHome"))
      Content already dirty ? $sdoc.getDocument().isContentDirty()
      $sdoc.save()
      $xwiki.getDocument("Sandbox.WebHome").date
      $xwiki.getDocument("Sandbox.WebHome").contentUpdateDate
      

      As we can see, the content is already considered dirty as soon as we retrieved it. Then we save without any change on the document, and the content update is the same as the last modification date.
      One of the main reason for this to happen, is that the method XWiki#setFullName does set the contentDirty flag to true. This method (setFullName) is called when retrieving a document.
      I don't have a fix for now, since I don't fully understand the implications of changing this, but the current behavior is wrong.

      Attachments

        Issue Links

          Activity

            People

              enygma Eduard Moraru
              jerome Jerome Velociter
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: