Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
1.7
-
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.