When a validation pattern is defined on a custom string property in Studio Modeler, the validation pattern provided to element nuxeo-input when the property is added in the create layout (by using the drag&drop in Studio Designer e.g.) is not enforced when the user submit the creation form in the Web UI. This only happens in Chrome, Firefox properly enforce the validation client-side.
In the Web UI, this could be a more impacting issue if the document creation includes a blob: the creation request is sent to the Nuxeo server (which does not happen with Firefox) and a server-side validation is performed and an error response is returned to the browser. That includes the removal of the batch containing the blob to attach to the document. This means that when the user fixes the validation error in the creation form in the Web UI and submit the form, no blob will be attached to the document as the batch has been removed.
How to reproduce:
- install the attached Marketplace package in a 2021 Nuxeo instance (nuxeoctl mp-install WEBUI-XXXX-package-1.0.0.zip)
- log in using a Chrome browser
- create a document of type WEBUI-XXXX:
- set field Title to WEB-XXXX-1
- set field Ent Description to "test ", make sure it has a trailing whitespace
- add/upload a file
- click the CREATE button
Expected result: the client-side pattern validation is performed and no HTTP POST request is sent, and the field Ent Description is highlighted (red) in error
Actual result: the client-side pattern validation is not performed and a HTTP POST request is sent, and the field Ent Description is highlighted (red) in error. After fixing the field Ent Descrition by removing the trailing whitespace, the document is created but without main blob
- is related to
-
NXP-32107 Blob still shows as uploaded in UI when batch has been dropped
- Resolved