Uploaded image for project: 'Nuxeo Web UI'
  1. Nuxeo Web UI
  2. WEBUI-1223

'nuxeo-input' element's pattern validation is not enforced in Chrome

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.0.25
    • Fix Version/s: None
    • Component/s: UI
    • Environment:
      Chrome
    • Tags:
    • Backlog priority:
      750
    • Sprint:
      UI - 2023-8, UI COOLDOWN - 2023-8, UI - 2024-02
    • Story Points:
      3

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: