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

$doc.display() does not find new properties until Save Objects is executed

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9.840
    • Fix Version/s: 1.0 B1
    • Component/s: {Unused} APIs
    • Labels:
      None
    • keywords:
      class add properties save object $doc.display()
    • Similar issues:

      Description

      As posted on the XWiki-users mailing list:

      After adding a new property "myNewProp" to class "myClass", executing
      $doc.display("myNewProp")
      in documents already containing instances of "myClass" returns nothing until I do "Edit Objects/Save Objects" on those documents.

      Ludovic's reply:

      It's not the intended behavior. It seems to be a bug in the $doc.display() function
      A workaround is to use a different display function

      #set($obj = $doc.getObject("XWiki.MyClass",0))
      $doc.display("myNewProp", "edit", $obj)

      You should add a task to http://jira.xwiki.org to fix this issue

        Attachments

          Activity

            People

            • Assignee:
              ludovic Ludovic Dubost
              Reporter:
              rewbs Robin Fernandes
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

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