Listing versions history on XP7


#1

Enonic version: 7.1.3
OS: Ubuntu 18.04.4 LTS

I’m implementing a task that will be importing content from an external API. While checking objects, the task will be either deleting, creating or updating (modifying + publishing) objects in Content Studio. I’ve noticed, however, that the versions my objects are not listed in the ‘Version history’ widget after modifying/publishing content using contentLib. Here are some of the tests I’ve performed so far:

  • Modifying media objects a few times has created a number of versions in the Version History just fine.
  • The exact same test mentioned above has been performed in other content-types of mine, in XP6, and the versions were also listed in the Version History.
  • Modifying an object manually in the Content Studio has also created new versions listed in the Version History.
  • When modifying objects in XP 7 while running my code no new versions listed in the Version History.
  • Checking the node versions with the ‘findVersions’ method from node lib, I can see the versions, but not in the version history widget.

I suspect that this is related to the updates in the node versions management in the XP7 described at How will 7.0 handle versions? and https://developer.enonic.com/docs/xp/stable/release#version_commits.

I wonder if this is a bug on XP7. Is there a way to force list new versions in the Version history widget when modifying the object with content API?


#2

I think this May be related to the version history widget filtrering out versions with similar modifiedTime. However, this should have been ser when by using the content API i would have assume?


#3

You are correct, the problem is in the time between the operations (modify and publish). Testing with a sleep() between the operations, the versions history are listed in the widget. Such as in the real case the task will run with some interval, there is some time between the operations and the version history in the widget should work fine. Thanks by the reply!