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

XWiki object api needs a read only mode

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 1.7
    • Old Core
    • None

    Description

      When manipulating xwiki objects using the public api the following case creates a bad state

      object = doc.getObject(classname)
      doc.setTitle("")
      object.set("fieldname", "value")
      doc.save()

      The change made in object.set() will not be taken into account because the document was cloned at the setTitle() function.
      Either the set api in object should be removed or we should make it check the status of the object (is it in write mode or read mode)

      This is bad because we can put the system in bad state and modify objects to which the user does not have write mode.
      If doc.save() is not called it is the real document and object that is changed in memory.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ludovic Ludovic Dubost
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: