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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 1.0 B1
    • 0.9.840
    • {Unused} APIs
    • None
    • class add properties save object $doc.display()

    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

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

            Dates

              Created:
              Updated:
              Resolved: