Bug 91837 - Inconsistent error messages when failing to input required fields
Summary: Inconsistent error messages when failing to input required fields
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Julien Nabet
URL:
Whiteboard: target:6.2.0 target:6.1.2
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-03 17:43 UTC by Alan Wheeler
Modified: 2018-09-27 17:08 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Wheeler 2015-06-03 17:43:59 UTC
To reproduce the problem :-

Step 1. Create table TestTable with 3 fields:-
Field Name	Field Type	AutoValue	Entry Required
Key		Integer		Yes		-
A		Text		 -		Yes
B		Text		-		No

Step 2. Create form TestForm from all fields in TestTable with arrangement “Columnar – Labels Left”.

Step 3. Edit the form so that “Input Required” for field B is “No”, but leave “Input Required” for both other fields as “Yes”.

Step 4. Use the form to try to enter data for a new record but only enter text into field B. When attempting to save the record, this results in a message saying :-
Error writing data to database
Input required in field ‘A’. Please enter a value.

Step 5. Select “OK”, enter text into field A, then attempt to save the record again – this will succeed.

Step 6. Without dismissing the form, select the “New Record” icon to redisplay a blank form.

Repeat step 4. This time, attempting to save the record results in a different message saying :-
Error inserting the new record
Attempt to insert null into a non-nullable column: column: A table: TestTable in statement [INSERT INTO “TestTable” (“B”) VALUES (?)]

The second error message is inconsistent with the first error message. Repeating the first error message would be far more user-friendly.
Comment 1 Alex Thurgood 2015-06-04 10:28:24 UTC
So my guess is that the first error message is generated from the form properties, and the second from the insert statement.

From the description, it appears that the form property constraints are ignored when you switch to a new record entry, and then the SQL parser throws an error.
Comment 2 Alex Thurgood 2015-06-04 10:36:51 UTC
Confirming on 

LO 4432

OSX 10.10.3
Comment 3 robert 2015-07-01 09:55:37 UTC
Couldn't this be the same as described in bug75340 and bug75341?
Comment 4 Alex Thurgood 2015-07-01 10:42:54 UTC
(In reply to robert from comment #3)
> Couldn't this be the same as described in bug75340 and bug75341?

Sure looks like it, I'd go for 75340
Comment 5 Alex Thurgood 2015-07-01 10:43:15 UTC

*** This bug has been marked as a duplicate of bug 75340 ***
Comment 6 Julien Nabet 2015-10-11 14:42:55 UTC
Since I can reproduce this one with LO Debian package 5.0.2 and with master sources updated today but not tdf#75340 (see my last comment here: https://bugs.documentfoundation.org/show_bug.cgi?id=75340#c13), I put this one to NEW again.
Comment 7 Alan Wheeler 2016-03-17 23:54:52 UTC
Still present lib LibreOffice 5.1.1.3
Comment 8 Alan Wheeler 2016-05-24 07:37:45 UTC
Still present in LibreOffice 5.1.3.2
Comment 9 QA Administrators 2017-09-01 11:20:18 UTC Comment hidden (obsolete)
Comment 10 Alan Wheeler 2017-09-01 12:21:13 UTC
Still present in LibreOffice 5.4.1 (Windows 10 64bit)
Comment 11 QA Administrators 2018-09-02 02:50:28 UTC Comment hidden (obsolete)
Comment 12 robert 2018-09-02 07:39:45 UTC
Bug still exists in LO Version: 6.1.0.3
Build-ID: efb621ed25068d70781dc026f7e9c5187a4decd1
OpenSUSE 15, 64bit rpm Linux.
Comment 13 Julien Nabet 2018-09-04 21:09:58 UTC
Code pointer:
3734             if ( !rColInfo.xFirstControlWithInputRequired.is() && !rColInfo.xFirstGridWithInputRequiredColumn.is() )
3735                 continue;

https://opengrok.libreoffice.org/xref/core/svx/source/form/formcontroller.cxx#3734

First time, when message is comes from the form, !rColInfo.xFirstControlWithInputRequired.is() = false and !rColInfo.xFirstGridWithInputRequiredColumn.is() = true

Second time, when message doesn't come from the form, obviously
!rColInfo.xFirstControlWithInputRequired.is() = true and !rColInfo.xFirstGridWithInputRequiredColumn.is() = true
Comment 14 Alan Wheeler 2018-09-05 14:11:29 UTC
Tested with LibreOffice 3.3.0.
Exactly the same symptoms as described in the original bug report are exhibited using 3.3.0, so set version to "Inherited from OOo"
Comment 15 Julien Nabet 2018-09-05 21:29:44 UTC
I submitted this patch on gerrit:
https://gerrit.libreoffice.org/#/c/60059/
Comment 16 Commit Notification 2018-09-06 04:48:46 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d80b3235cc106e17a0c10dea44e8afa8db724400

tdf#91837: fix deinitializeControls (forms)

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 17 Julien Nabet 2018-09-06 07:35:13 UTC
Backports waiting for review in gerrit
6.1: https://gerrit.libreoffice.org/#/c/60065/
6.0: https://gerrit.libreoffice.org/#/c/60066/
Comment 18 Commit Notification 2018-09-07 08:17:53 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c9d15d30b66102aff3f3e10bb8243edf2ab77334&h=libreoffice-6-1

tdf#91837: fix deinitializeControls (forms)

It will be available in 6.1.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 19 Julien Nabet 2018-09-07 08:31:10 UTC
Just for information, since analyzing consequences of the patch on 6.0 may take some time and 6.0 branch will be soon EOL , the fix won't be backport on it.
Comment 20 Alan Wheeler 2018-09-27 16:37:27 UTC
I can confirm that the error has been corrected in LibreOffice 6.1.2.1 (Windows 10 64-bit).


Thanks Julien
Comment 21 Julien Nabet 2018-09-27 17:08:38 UTC
Thank you Alan for your feedback, let's put this one to VERIFIED then.