I set a Pattern Validation Rule for a string (single line text) field, e.g. \d{4}. The validation only worked for the first editing. Subsequently, it always throws an error warning: “Study ID” with value “1001” fails to match the required pattern: /[object Object]/. It seems the regex expression was changed internally after the first submission.
* Environment
NocoBase version: v2.0.0-alpha.56
Database type and version: PostgreSQL 16
OS: Server - Ubuntu 24.04.3 LTS, Client - Windows 11
To set a Pattern Validation Rule (e.g. \d{4}) for a string (single line text) field (e.g. Study ID).
The validation only worked for the first submission in the Edit Form. Subsequently, it always throws an error warning: “Study ID” with value “1001” fails to match the required pattern: /[object Object]/.
Expected behavior
It can check the field value against the regex expression.
Screenshots
NA
Logs
I don’t see any error log generated in docker compose logs when it gives the error warning in the Edit Form.
Hello, I couldn’t reproduce your problem. Please reproduce it in the demo and provide the link to reproduce it.
https://a_8hwne7u84ho.v13.demo.nocobase.com/admin/
I can reproduce the bug situation in Chrome, Firefox and Brave browsers. Furthermore, I have set the pattern validation rule to be \d{4} for the field Study ID. However, Study ID “1234567567” can be still saved in the collection. It could be a bug.
My PC is Windows 11 Enterprise (Version: 24H2, OS build: 26100.6899). Each browser (Edge, Chrome, Firefox, and Brave) in my PC can reproduce this bug. Could you investigate this bug? Do you need any logs? Thanks.
It works fine right after a system restart, but after I edit the form and submit, the regex validation breaks and turns into /[object Object]/. Please try to submit the form to replicate this issue.
Refreshing the page, logging out and back in, or reopening the browser doesn’t fix it. The issue persists until the system is restarted again.