Skip to content
Snippets Groups Projects
Commit 924a7228 authored by Marius Dumitru Florea's avatar Marius Dumitru Florea
Browse files

XWIKI-8623: AddObject action ignores the submitted property values

* Add comment to explain why we use only the class name without the object number.
parent f9ee2405
No related branches found
No related tags found
No related merge requests found
......@@ -65,10 +65,13 @@ public boolean action(XWikiContext context) throws XWikiException
EntityReference classReference = this.relativeResolver.resolve(className, EntityType.DOCUMENT);
BaseObject object = doc.newXObject(classReference, context);
// We need to have a string in the map for each field for the object to be correctly created.
// Otherwise, queries using the missing properties will fail to return this object.
BaseClass baseclass = object.getXClass(context);
// The request parameter names that correspond to object fields must NOT specify the object number because the
// object number is not known before the object is added. The following is a good parameter name:
// Space.Class_property. As a consequence we use only the class name to extract the object from the request.
Map<String, String[]> objmap = oform.getObject(className);
// We need to have a string in the map for each field for the object to be correctly created.
// Otherwise, queries using the missing properties will fail to return this object.
@SuppressWarnings("unchecked")
Collection<PropertyClass> fields = baseclass.getFieldList();
for (PropertyClass property : fields) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment