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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.5.2, 1.6.1, 1.7 M1
    • Fix Version/s: None
    • Component/s: Model
    • Labels:
    • Similar issues:

      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

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: