Steps to reproduce :
- Start with a clean instance
- Import the attached XAR package, it contains a simple AWM with 1 content page
- Edit the content page in object mode, try to add a new object of the "my test app" class
Expected : the object gets added
Actual : when refreshing the page, the object is not displayed anymore
This seems to come from the improvements performed as part of
XWIKI-16210 : when a document is saved, we check if a request parameter addedObjects exists, and try to register the objects to add to the document.
In order to validate the contents of the request parameter addedObjects, we apply a regex XOBJECTS_REFERENCE_PATTERN, defined here ; the issue is that this pattern does not cover classes which have special characters (spaces, \, /, …) in their document name.
While it's a good practice to create class documents without special characters in their document names, it's certainly not the case always : for example, it's always possible to create an AWM with special characters.
This may also impact the pattern XPROPERTY_REFERENCE_PATTERN here.