Bug 120603 - Misleading error messages resulting from fixes for bug #120353
Summary: Misleading error messages resulting from fixes for bug #120353
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
(earliest affected)
Hardware: All All
: medium enhancement
Assignee: Not Assigned
Depends on:
Blocks: Error-Messages
  Show dependency treegraph
Reported: 2018-10-15 08:23 UTC by tim
Modified: 2019-05-02 11:03 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description tim 2018-10-15 08:23:51 UTC
It seems Base forms were not properly respecting the 'Input Required' setting on forms.  This was corrected in 6.1.3 (and later).

The result of this is that if a database field is defined as optional, but the corresponding form field is marked 'input required', the user is given an error message stating:

"Error writing to the database"
"Input required in field 'xyz'. Please enter a value".

This implies there's a database problem, when there isn't. There's a form problem.

This might not matter much in normal situations, but given the change (correction) in the behaviour of Base, I believe many will be seriously misled by this.  The fix can potentially affect hundreds of fields in many, many forms, and can be a lot of work to adjust to.  A misleading error message will cause problems, and probably more duplicate issue reports raised unnecessarily.
Comment 1 Alex Thurgood 2018-11-09 08:58:53 UTC
See also :

Comment 2 Xisco Faulí 2019-01-22 16:31:40 UTC
@Julien Nabet, Any opinion here?
Comment 3 Julien Nabet 2019-01-22 17:59:35 UTC
About "Input required in field 'xyz'. Please enter a value"., it's in https://opengrok.libreoffice.org/xref/core/include/svx/strings.hrc?r=c89a4996#1108

but "Error writing to the database" is nowhere to be seen in Opengrok so don't know where it comes from :-(
Comment 4 Lionel Elie Mamane 2019-01-22 18:01:13 UTC
AFAIR, the same message is used whether the restriction is in the form or in the database.
Comment 5 Lionel Elie Mamane 2019-03-21 13:08:25 UTC
Since LibreOffice 6.1.4 (and from somewhere in early December 2018), odb files last saved by earlier versions of LibreOffice will have all form controls set to "Input required: no". See bug 120353 comment 27.

This should massively help to sidestep this.

Giving a different error message when the "input required" bit comes from the form or from the database can still be considered a worthy enhancement.
Comment 6 Julien Nabet 2019-03-21 13:35:55 UTC
(In reply to Lionel Elie Mamane from comment #5)
> Giving a different error message when the "input required" bit comes from
> the form or from the database can still be considered a worthy enhancement.

If I understand well, you want to distinguish these 2 cases:
- xFirstControlWithInputRequired
- xFirstGridWithInputRequiredColumn
see https://opengrok.libreoffice.org/xref/core/svx/source/form/formcontroller.cxx?r=cec7ae9f#219

So in function FormController::approveRowChange
(cf https://opengrok.libreoffice.org/xref/core/svx/source/form/formcontroller.cxx?r=cec7ae9f#3706)
instead of:
3706              OUString sMessage( SvxResId( RID_ERR_FIELDREQUIRED ) );
3707              sMessage = sMessage.replaceFirst( "#", rColInfo.sName );
It would be something like:
OUString sMessage( xFirstControlWithInputRequired?SvxResId( RID_ERR_FIELDREQUIRED _DB):SvxResId( RID_ERR_FIELDREQUIRED_FORM ));

(or reuse RID_ERR_FIELDREQUIRED for DB and change the content to explicitly quote database and add RID_ERR_FIELDREQUIRED_FORM)
Comment 7 Xisco Faulí 2019-05-02 11:03:20 UTC
Moving to NEW