Bug 140383 - Base, Form, Table Default Date not working
Summary: Base, Form, Table Default Date not working
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.1.0.3 release
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-12 23:27 UTC by Joe Castor
Modified: 2021-07-15 19:49 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of form with standalone fields and table control (15.78 KB, image/png)
2021-07-14 14:14 UTC, Robert Großkopf
Details
Database with the form and a standalone datefield and a datefield in a tablecontrol. (11.94 KB, application/vnd.oasis.opendocument.database)
2021-07-14 14:15 UTC, Robert Großkopf
Details
screen shot of Form edit (267.38 KB, image/jpeg)
2021-07-14 17:44 UTC, Joe Castor
Details
screen shot of live form (204.10 KB, image/jpeg)
2021-07-14 17:45 UTC, Joe Castor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Castor 2021-02-12 23:27:50 UTC
Description:
The Table on a form has a field to contain a transaction date. Using the Form Navigator and Table tool, clicking on the date field, I have the Min and Max dates set (01/01/2017 & 12/31/2200), and the Default date set to 01/01/2021. When entering a transaction, the date field populates to Min Date instead of Default Date. It ignores the default date.

Steps to Reproduce:
1.Create a Form with a Table containing a date. Table is database table containing a transaction date.
2.Either while creating, or Edit, using the Table tool and Form Navigator, select the Date field, then enter Min Date, Max Date and Default Date. Save.
3.Next, under normal Form use, begin to add a record to the Table and check the Default Date contained in the date field of the new record. You'll find that it is the Min Date and not Default Date.

Actual Results:
Min Date is given instead of Default Date

Expected Results:
Default Date


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 6.4.5.2 (x64)
Build ID: a726b36747cf2001e06b58ad5db1aa3a9a1872d6
CPU threads: 4; OS: Windows 10.0 Build 19041; UI render: default; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded
Comment 1 Alex Thurgood 2021-02-15 08:41:07 UTC
Pretty sure this is a DUP. Need to find the older report.
Comment 2 Alex Thurgood 2021-02-25 11:12:32 UTC
@Joe :

Is the problem apparent with any database backend, or only certain ones ?
For example, does the problem occur with both an embedded Firebird and an embedded HSQLDB ODB file, or just with one of those DB backends ?

Additionally, LO 6452 is now end of life (November 30th, 2020), so no further updates/fixes or changes will be released for that line of LO.

Is the problem also present in current production releases of LO ?
Comment 3 Alex Thurgood 2021-02-25 11:18:56 UTC
@Joe:

Do you have a default date set at the Table definition level ?

If so, then this would appear to override any form settings that you might have made, see for example the discussion on bug 138412
Comment 4 Joe Castor 2021-02-25 14:18:06 UTC
Re Comment 2: Alex, I Updated to 7.1.0.3 and the problem persists. This is a vanilla LO installation using a split database. The form was created using Form Wizard and HSQL. I'm not sophisticated enough to venture into those other environments.

Re Comment 3: There is a default date in the table, which I'm not able to modify, however that date is not used or provided at time of new record/entry creation. The field continues to be populated with Min. Date, which is different from the default Table date. I reviewed the  bug 138412 and my issue is not behaving as descried, such that the default date set in the Table is not being used. I call for Default date as set in the Form and get Min Date as set in the Form.
Comment 5 Alex Thurgood 2021-03-01 16:04:49 UTC
Thanks Joe !

Unfortuantely, I can't hepl out with split databases, they don't work in LO for MacOS without ruining existing embedded hsqldb files (and having to remove existing hsqldb.jar files from the macOS installation, which invalidates the digital signature of the bundle).
Comment 6 Joe Castor 2021-03-01 16:43:36 UTC
Alex, thanks for having a look. I suspect, however, that the Form functions would be the same for embedded or split.
Comment 7 Alex Thurgood 2021-03-02 11:05:03 UTC
There's a little bell ringing in the back of my mind that this never worked for some reason...

I remember trying something similar a long time ago with a mysql backend, and the default date that I had entered in the Form control property would never get written to the underlying DB. However, at the time, I wasn't using Min/Max dates either side of the default date.

Still think that this is a duplicate, and quite old behaviour, but unfortunately, I can't find it in the bugzilla.
Comment 8 Alex Thurgood 2021-03-02 11:13:48 UTC
Hmm, more searching and it seems very similar to bug 45606, to the extent that the GUI form control pre-determined default value is not written to the db backend.

As one can see in bug 45606, nothing has happened in that regard since it was first reported back in 2012...
Comment 9 Alex Thurgood 2021-03-02 11:19:23 UTC
See also bug 56612, relating to trying to set the default of a tri-state tickbox control in a form via the GUI properties of the control.
Comment 10 Alex Thurgood 2021-03-02 11:20:20 UTC
I would be inclined to mark this bug as just another duplicate of the basic inconsistency in handling of default GUI-set values reported in bug 45606.
Comment 11 Alex Thurgood 2021-03-02 11:21:50 UTC
@Joe : it seems that the only way to force your default date rather than the MinDate would be to modify the field definition in your hsqldb database.
Comment 12 Alex Thurgood 2021-03-02 11:27:03 UTC
For a bit of history around default dates defined in the DDL, and external database backends (which would include hsqldb), see also bug 47468.
Comment 13 Alex Thurgood 2021-03-02 11:31:09 UTC
More info and comment in bug 50478
Comment 14 Joe Castor 2021-03-02 16:09:31 UTC
Alex, thank you for your time spent researching my issue. I reviewed 45606 and 56612. While there are some condition similarities, It doesen't seem to reflect what I'm experiencing. 
First, the Form Table line Date field is being populated with a value equal to Min Date that I set in the Form control. This is always different than the default date in the Table itself (I purposely make sure it is different). I can change the Min Date and Default Date in the Form control, but the new record Date will always follow the Min Date. The Default Date is ignored. This Min Date, if left unchanged, is what is written to the Table on record addition.
To me, it seems as though these is a coding assignment error in that it is pointing to the wrong Form control field; Min instead of Default.
Comment 15 Robert Großkopf 2021-07-14 10:39:48 UTC
Tested this bug.

First I thought: What a crazy new dialog in LO 7.2.0.1 to change min date, max date and default date for a field. Only a calendar is shown for input values and stepping through the years from 1900 to today …

In LO 7.2.0.1 I couldn't find a buggy behavior here. The shown value in the table control of a form is the same as the shown value of the separate field: The default value I have chosen.

Think this is independent of the database you use. It must be set by the control.

Tested with OpenSUSE 15.2 64bot rpm Linux.
Comment 16 Joe Castor 2021-07-14 13:16:26 UTC
Thank you Robert for looking at this bug.
However, it seems that the issue is misunderstood. In the Form, Forms Control/Table Control, a date field can be set with a "min", "max" and "Default" dates. I use "Default" specifically to reduce key strokes for entering current /todays date (it would be nice if Default Date could be today's date). 
The purpose of Min and Max should be only for safeguarding a date range when creating a date entry.
The issue is that while "Default" is what I expected (assumption from its name) in the Form Control, the table fills the field with Min date instead of Default. 
It seems that the problem might be in the Table Control coding, in that it is looking to the wrong control field entry. Just thinking...
Joe Castor
Comment 17 Robert Großkopf 2021-07-14 14:14:17 UTC
(In reply to Joe Castor from comment #16)
> Thank you Robert for looking at this bug.
> However, it seems that the issue is misunderstood. In the Form, Forms
> Control/Table Control, a date field can be set with a "min", "max" and
> "Default" dates. I use "Default" specifically to reduce key strokes for
> entering current /todays date (it would be nice if Default Date could be
> today's date). 
> The purpose of Min and Max should be only for safeguarding a date range when
> creating a date entry.
> The issue is that while "Default" is what I expected (assumption from its
> name) in the Form Control, the table fills the field with Min date instead
> of Default. 

Have a look at the attachment. Have set date min as 2000-01-01 and default date as 2021-07-14.
Comment 18 Robert Großkopf 2021-07-14 14:14:54 UTC
Created attachment 173564 [details]
Screenshot of form with standalone fields and table control
Comment 19 Robert Großkopf 2021-07-14 14:15:51 UTC
Created attachment 173565 [details]
Database with the form and a standalone datefield and a datefield in a tablecontrol.
Comment 20 Stang 2021-07-14 14:38:23 UTC
Using:

Version: 7.1.4.2 / LibreOffice Community
Build ID: a529a4fab45b75fefc5b6226684193eb000654f6
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

on Ubuntu 20.04.2 I have seen nothing but problems with setting various items in the Date Control.  Even with the sample posted I cannot set a default date.  There is no direct entry for a wanted date - Date min, Date max, Default date.

With Date max set with a year of 2030, if a change to 2021 is wanted then you must scroll through 9 years. Then even when the change is saved, re-open and it is unset.

Has been this way for some time even with a new user profile.  Control is terrible in multiple ways.
Comment 21 Robert Großkopf 2021-07-14 15:14:59 UTC
(In reply to Stang from comment #20)
> Using:
> 
> Version: 7.1.4.2 / LibreOffice Community
> Build ID: a529a4fab45b75fefc5b6226684193eb000654f6
> CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
> Locale: en-US (en_US.UTF-8); UI: en-US
> Calc: threaded

Could be you have special problems with VCL: gtk3.

> 
> Has been this way for some time even with a new user profile.  Control is
> terrible in multiple ways.

I created the database with LO 6.4.7.2 here. Have installed many different version and this is the last I installed where I am able to set the values for mn date, max date und default date directly.

Have written a bugdescription for the new selection, which only uses a calendar to scroll from Year 1800 every month to year 2000: bug 143357
Comment 22 Stang 2021-07-14 16:02:25 UTC
Basic problem - any change to Min, Max or Default dates will not be saved.

Whether gtk3 used or not should not be an issue.
Comment 23 Stang 2021-07-14 16:15:34 UTC
No need to respond to my last comment.  I realize it is not exactly in concert with the posted problem.  Did originally send this poster here as I had verified the problem originally elsewhere.

At the same time saw the many other problems with this control.  Just getting tired of things going bad in Base when there is little or now progress going on.

About to give up on it all.
Comment 24 Joe Castor 2021-07-14 17:44:28 UTC
Created attachment 173580 [details]
screen shot of Form edit
Comment 25 Joe Castor 2021-07-14 17:45:51 UTC
Created attachment 173581 [details]
screen shot of live form
Comment 26 Robert Großkopf 2021-07-14 18:40:13 UTC
(In reply to Stang from comment #23)
> 
> At the same time saw the many other problems with this control.  Just
> getting tired of things going bad in Base when there is little or now
> progress going on.

There have been made many changes in GUI for LO 7.*. I have seen this first when I tried to reproduce the bug. Have written a new bug for it today. One member of QA saw this bug, could reproduce and could find the committer, who has committed the code for this problem. I think it will be fixed really fast…

Did you try the database I attached? What date will be shown for you when creating a new entry?
Comment 27 Stang 2021-07-14 21:42:12 UTC
(In reply to Robert Großkopf from comment #26)
> (In reply to Stang from comment #23)
> > 
> > At the same time saw the many other problems with this control.  Just
> > getting tired of things going bad in Base when there is little or now
> > progress going on.
> 
> There have been made many changes in GUI for LO 7.*. I have seen this first
> when I tried to reproduce the bug. Have written a new bug for it today. One
> member of QA saw this bug, could reproduce and could find the committer, who
> has committed the code for this problem. I think it will be fixed really
> fast…
> 
> Did you try the database I attached? What date will be shown for you when
> creating a new entry?

As stated in comment 20 I cannot set a any date (used your sample).  Gets reset immediately.
Comment 28 Stang 2021-07-15 01:27:19 UTC
It appears to use the current date - for me 07/14/21
Comment 29 Robert Großkopf 2021-07-15 05:52:41 UTC
(In reply to Stang from comment #28)
> It appears to use the current date - for me 07/14/21

Then it is working right for you. This is the default, because I had set up the database on 07/14/21 and set the default date as 07/14/21.

To set the current date through the date control directly is impossible. You have to use macros or other little "tricks". The database will show the date 07/14/21 also today, where it is 07/15/21.

Please create an example which shows the behavior you get with your database: Using date min instead of date default. Attach the example to this bug.
Comment 30 Alex Thurgood 2021-07-15 08:46:58 UTC
Tested Robert's ODB file in

Version: 7.1.4.2 / LibreOffice Community
Build ID: a529a4fab45b75fefc5b6226684193eb000654f6
CPU threads: 8; OS: Mac OS X 10.16; UI render: default; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded

I couldn't reproduce the problem described by Joe, the default date as set in the Control properties of the form is always set in the GUI and written to the underlying table.
Comment 31 Alex Thurgood 2021-07-15 09:27:17 UTC
Just to test, I also changed the default date in properties of the Form control, saved the form, re-opened the form for data entry and added a new entry. The new default date appeared against my new entry exactly as I had set it. So this appears to be working for me as intended, even if I change the default date via the control's properties.
Comment 32 Stang 2021-07-15 14:49:30 UTC
(In reply to Robert Großkopf from comment #29)
> (In reply to Stang from comment #28)
> > It appears to use the current date - for me 07/14/21
> 
> Then it is working right for you. This is the default, because I had set up
> the database on 07/14/21 and set the default date as 07/14/21.
> 
> To set the current date through the date control directly is impossible. You
> have to use macros or other little "tricks". The database will show the date
> 07/14/21 also today, where it is 07/15/21.
> 
> Please create an example which shows the behavior you get with your
> database: Using date min instead of date default. Attach the example to this
> bug.

NO. It is NOT working right for me.  Today it again shows 07/14/21 and I cannot change it to anything else.  How is that right!

Done with this.
Comment 33 Robert Großkopf 2021-07-15 15:20:02 UTC
(In reply to Stang from comment #32)
> (In reply to Robert Großkopf from comment #29)
> > (In reply to Stang from comment #28)
> > > It appears to use the current date - for me 07/14/21
> > 
> > Then it is working right for you. This is the default, because I had set up
> > the database on 07/14/21 and set the default date as 07/14/21.
> > 
> > To set the current date through the date control directly is impossible. You
> > have to use macros or other little "tricks". The database will show the date
> > 07/14/21 also today, where it is 07/15/21.
> > 
> > Please create an example which shows the behavior you get with your
> > database: Using date min instead of date default. Attach the example to this
> > bug.
> 
> NO. It is NOT working right for me.  Today it again shows 07/14/21 and I
> cannot change it to anything else.  How is that right!
> 
> Done with this.

That is the behavior of a default in the GUI. It shows the content which is set in the field as default. It doesn't show the content of min date. And this is the bug you reported.
Comment 34 Stang 2021-07-15 18:52:01 UTC
(In reply to Robert Großkopf from comment #33)
> (In reply to Stang from comment #32)
> > (In reply to Robert Großkopf from comment #29)
> > > (In reply to Stang from comment #28)
> > > > It appears to use the current date - for me 07/14/21
> > > 
> > > Then it is working right for you. This is the default, because I had set up
> > > the database on 07/14/21 and set the default date as 07/14/21.
> > > 
> > > To set the current date through the date control directly is impossible. You
> > > have to use macros or other little "tricks". The database will show the date
> > > 07/14/21 also today, where it is 07/15/21.
> > > 
> > > Please create an example which shows the behavior you get with your
> > > database: Using date min instead of date default. Attach the example to this
> > > bug.
> > 
> > NO. It is NOT working right for me.  Today it again shows 07/14/21 and I
> > cannot change it to anything else.  How is that right!
> > 
> > Done with this.
> 
> That is the behavior of a default in the GUI. It shows the content which is
> set in the field as default. It doesn't show the content of min date. And
> this is the bug you reported.

Don't know why I am posting this as have stated this a number of times but it is ignored.

This is not the reported bug as I stated this in comment #23

Cannot save any changes on date control properties of Min, Max or Default dates.

Can change but will automatically change back.

Min date 01/01/1800 changed to 01/01/1801 will change back to 01/01/1800 after closing the Properties dialog.  Max and Default do the same.

As originally stated, the control is currently nearly worthless.
Comment 35 Robert Großkopf 2021-07-15 19:49:33 UTC
(In reply to Stang from comment #34)

Please see what is written from Joe for starting this bug 2021-02-12 23:27:50 UTC . What you are writing has nothing to do with the description there.

Could be something like bug 143357 .

And if this is not the bug what is written there: Write a new bug.