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

Adding a computed field property to an XWiki class updates all the pages having an object of that class with an empty revision



    • Bug
    • Resolution: Duplicate
    • Critical
    • None
    • 12.10.8
    • Old Core
    • None
    • Unknown
    • N/A
    • N/A


      How to reproduce:

      • create a class on the wiki - the simplest is with an app within minutes
      • create a couple of pages with an object of this class each
      • go to the class - directly in the class editor it's simpler
      • add a new property of type "computed field" to that class

      Actual result:

      • all the pages with objects of that class are marked as modified in their history, with a revision with message: "Migrated property [...] from class [...]"
      • when diffed with previous version in history, this revision appears empty (no changes compared to previous version)

      Expected result:

      • there is no alteration or modification of the pages that contain objects of that class
      • since the computed field properties are not supposed to have any value, should exist only at the level of the class and only for view (they're not even available for input in edit mode), they have no reason to leave any trace in the actual content document.

      This is the same situation that is described by issue XWIKI-17633 , except that in this case it's about a computed field , so there shouldn't even be any change on the content.

      Re-saving all content pages is bothering because it alters the timeline of the wiki, the document's last modification date metadata becomes irrelevant, wherever it appears.
      Document's last modification date is an important metadata for retrieving content - besides it being available all over the place in the index application it's also a standard facet of the search - see also XWIKI-18815 .

      Very important: there is no way to "fix" the updated pages if they were impacted by this issue and bring them back to their previous modification date, other than restoring from a backup. Of course, if the issue is discovered late and there were already some changes on content in the meantime, restoring from backup is no longer an option.

      Also, the class editor (the default complete one, not the one from AWM) is a bit tricky and adds a new property when the "add" button for the property is hit, not when hitting "save" at the bottom of the page, so even before hitting "save" on the page the damage is done.


        Issue Links



              tmortagne Thomas Mortagne
              lucaa Anca Luca
              0 Vote for this issue
              2 Start watching this issue