Created attachment 187049 [details] XML form document with two fields, user defined data Open the attached XML form document. There are 2 form fields. Both fields haven't filled with content. Both fields will appear with red border. First field will change color with 5 digits, second field will need 5 characters (also digits possible). Now have a look at the properties for this fields. You could get them from the bindings, the entry in Instance 1 or direct from the properties of the form control. Data → Required isn't set. But there is set for both field a user create data type. The control will always react as if Data → Required is set. So it is impossible to set something like "let it blank or put 5 digits for a postcode". Bug appears in all LO versions here.
The red border indication only appears with 4829a85d0753c93419bd46b1d50bcfa6f0f3f1da tdf#154734: XML Form doc: all binded fields will be shown as fields... Julien: maybe you are interested in this.
I gave a try with https://gerrit.libreoffice.org/c/core/+/151733
Remark: I noticed that to set the field as required, you must put "1" (without quotes in the field). I thought that putting "true" would be the right way.
Julien Nabet committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/aa0cbe2c82bbc2295b51357378a68da0d64a44a0 tdf#155121: XML Form Document: better take into account "not required" It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Robert: not sure it's completely ok (I mean perhaps it has some negative impact I didn't see) so before I cherry-pick this for 7.5 branch, would it be possible you give it a try once a daily build will be available with the commit?
(In reply to Julien Nabet from comment #3) > Remark: I noticed that to set the field as required, you must put "1" > (without quotes in the field). I thought that putting "true" would be the > right way. If I set required in Binding or Instance of a field it will appear as "true()" in control properties → data → Required. But I don't want to set this for user defined data. The red border will also appear in older versions of LO. Had appeared when I wrote the first description for xml form documents in LO 6.0. Could see this red border for user defined data type in LO 5.4.6.2 here also. I will have a look at the daily build, which includes this patch.
(In reply to Robert Großkopf from comment #6) > (In reply to Julien Nabet from comment #3) > > Remark: I noticed that to set the field as required, you must put "1" > > (without quotes in the field). I thought that putting "true" would be the > > right way. > > If I set required in Binding or Instance of a field it will appear as > "true()" in control properties → data → Required. But I don't want to set > this for user defined data. No pb, it was just a remark during some local tests I did. > > The red border will also appear in older versions of LO. Had appeared when I > wrote the first description for xml form documents in LO 6.0. Could see this > red border for user defined data type in LO 5.4.6.2 here also. Quite expected since the patch https://git.libreoffice.org/core/+/4829a85d0753c93419bd46b1d50bcfa6f0f3f1da%5E%21 shows that logic was just reversed.
Tested with Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community Build ID: 22950a9b008e1bb22fa9e54b5d45715e25fee764 CPU threads: 6; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb) Locale: de-DE (de_DE.UTF-8); UI: en-US Calc: threaded (2023-05-16) It will work now as expected. Great! Set this one to RESOLVED → FIXED
(In reply to Robert Großkopf from comment #8) > Tested with > Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community > Build ID: 22950a9b008e1bb22fa9e54b5d45715e25fee764 > CPU threads: 6; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb) > Locale: de-DE (de_DE.UTF-8); UI: en-US > Calc: threaded > > (2023-05-16) > > It will work now as expected. Great! > Set this one to RESOLVED → FIXED Thank you Robert for the feedback! :-)
Here's the cherry-pick for 7.5 branch: https://gerrit.libreoffice.org/c/core/+/151780 Now, it needs to be reviewed by a dev.
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-7-5": https://git.libreoffice.org/core/commit/be01da8c3020fec008307ab76b6cc89992381f02 tdf#155121: XML Form Document: better take into account "not required" It will be available in 7.5.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.