Issue 78816 - User defined date input fields do not retain correct data
Summary: User defined date input fields do not retain correct data
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: formatting (show other issues)
Version: OOo 2.1
Hardware: All All
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-22 21:32 UTC by kabing
Modified: 2013-09-17 02:37 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
date field problem test file (26.04 KB, application/vnd.oasis.opendocument.text)
2007-06-22 21:33 UTC, kabing
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description kabing 2007-06-22 21:32:19 UTC
When using input fields related to user fields defined as dates, the data
entered does not remain in date form upon saving and reopening.  User fields
connected to these input fields do not display the dates at all.  User fields
that are not linked to an input field work correctly.

To reproduce:

Open attached document (which is a template)
In response to the input field dialogs, enter three dates (erase any numbers
highlighted in blue in the entry box)
Look at document; the line after each "Input Field" date line should be
identical to the line above it; it is not
Go to View and check Field Names
You will see User Field XXXXX = with the correct dates in the lines that are
displaying incorrectly when field names is turned off.
Note that the final line is a user field, with a defined value, that is not
dependent on an input field.
Save as an ODT file
Close the file
Reopen the file
Under View, uncheck Field Names
Input Field values will be decimals
Other date field values will be wrong
(View Field Names will show decimals for the User fields)
Comment 1 kabing 2007-06-22 21:33:07 UTC
Created attachment 46197 [details]
date field problem test file
Comment 2 michael.ruess 2007-06-25 08:25:27 UTC
Reassigned to ES.
Comment 3 Raphael Bircher 2008-06-26 11:22:13 UTC
rbircher -> torwart

Pleas have a look on this issue. Thanks!
Comment 4 sgautier.ooo 2008-07-24 18:04:44 UTC
Hi Eric, 

I think the issue is that the internal date number is stored in the user field
instead of the real date value i.e. if you input 11.02.07 (MMDDYY) the value
stored is 39388.
Tested on OOoDev300_m26FR and Ubuntu 8.4

Steps to simply reproduce: 
Ctrl+F2, variables tab, select User Field
Name it UF1 value  11.02.07
Format as date MMMM J AAAA
Click on the green mark to validate the format
Insert the field --> date is correctly inserted and formatted

Without closing the dialog
Click on Input field, UF1 is selected under Selection area
Click on Insert
The "internal" date number is shown : 39388
Click ok without changing anything --> this number 39388 is inserted

Click again on Input Field and enter a value as a date formatted MMDDYY
Both Input Fields will have the date you just enter, but formatted as you enter
them.
The User Field will now display December 30 1899

I let it as unconfirmed because I'm not sure that it's not another issue than
the one described here. For me it's the same because of the original storage of
the date number, but I may be wrong :)
Kind regards - Sophie
Comment 5 sgautier.ooo 2008-07-24 18:05:44 UTC
add me in cc
Comment 6 Joe 2012-09-25 16:07:04 UTC
Upon my failure to replicate this specific report, I decided to make a document where I inputted the original UF1 input twice on different lines and a UF2 input  twice on different lines in the same document. UF2 was in the format of D MMMM YYYY and upon saving and closing o the document, the UF1 inputs were the same as 11.02.07; however, my date of 8 12 1997 for the UF2 [ D MMMM YYYY format ] both returned as only 1997. This although, a different instance of this bug, confirms that there is a preservation of data issue within OpenOffice and needs to be looked into.
Comment 7 Joe 2012-09-25 16:10:00 UTC
(In reply to comment #6)
> Upon my failure to replicate this specific report, I decided to make a
> document where I inputted the original UF1 input twice on different lines
> and a UF2 input  twice on different lines in the same document. UF2 was in
> the format of D MMMM YYYY and upon saving and closing o the document, the
> UF1 inputs were the same as 11.02.07; however, my date of 8 12 1997 for the
> UF2 [ D MMMM YYYY format ] both returned as only 1997. This although, a
> different instance of this bug, confirms that there is a preservation of
> data issue within OpenOffice and needs to be looked into.

This was tested on Windows 7 OS SP1
Comment 8 Joe 2012-09-25 16:10:57 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Upon my failure to replicate this specific report, I decided to make a
> > document where I inputted the original UF1 input twice on different lines
> > and a UF2 input  twice on different lines in the same document. UF2 was in
> > the format of D MMMM YYYY and upon saving and closing o the document, the
> > UF1 inputs were the same as 11.02.07; however, my date of 8 12 1997 for the
> > UF2 [ D MMMM YYYY format ] both returned as only 1997. This although, a
> > different instance of this bug, confirms that there is a preservation of
> > data issue within OpenOffice and needs to be looked into.
> 
> This was tested on Windows 7 OS SP1 in version OOo 3.4.1
Comment 9 rculp2009 2012-09-25 22:53:49 UTC
Entering 39554 for the input displays the 'correct' date assuming no parsing. Shouldn't it not know what to do on that input for MMDDYY? Also 395541 is December 13'th 2982... Using Windows 7 OS. The problem may be in the parsing of the input field (or lack of)
Comment 10 rculp2009 2012-09-25 23:05:50 UTC
Also I was able to replicate the bug as originally seen in the reproduce steps.
Comment 11 rculp2009 2012-09-27 22:11:24 UTC
10.11.12 is being saved as 0.12 as well as 10.11.1200
Jan102012 gets saved as 0 and 
RAWR! is saved as 0 RAWR!! and RAWR!!!! are saved as 1
Comment 12 Joe 2012-09-28 18:39:08 UTC
(In reply to comment #10)
> Also I was able to replicate the bug as originally seen in the reproduce
> steps.

I also was able to replicate the report of the original reproduction steps; however, tried to replicate the more in-depth tests from the second report as to try and further the testing of this particular bug.
Comment 13 rculp2009 2012-09-29 02:05:06 UTC
Sorry for the earlier non-sense. Here is some clarification. Hope it helps.

OS used: Windows 7 Professional
Open Office build used: 9593

Following the OP's reproduce steps, I was able to recreate the bug as he described.

Using the attachment 46197 [details] in comment 2 I did these experiments. Note that the results are the same for all 3 fields.

Input: 10/10/10
No update to following line. Even after save and reopen.
After save, close, and reopen; the input field becomes 0.1
Note 10/10 = 1; 1/10 = 0.1;

Input: 10/10/1000
No update to following line. Even after save and reopen.
After save, close, and reopen; the input field becomes 0.001
Note 10/10 = 1; 1/1000 = 0.001;

Input: 101010
The following line after the input line immediately updates to July 20, 2176
After save, close, and reopen; the input field is still 101010

Input: 25*4
The following line after the input line immediately updates to April 9, 1900
After save, close, and reopen; the input field becomes  100
Note 25*4 = 100

Input: 500/5
The following line after the input line immediately updates to April 9, 1900
After save, close, and reopen; the input field becomes  100
Note 500/5 = 100

For a formatted input field, these results are completely unexpected and in the case of the first two inputs tested, completely different from what the user defined.
Comment 14 Rob Weir 2013-07-30 02:22:33 UTC
Reset assignee on issues not touched by assignee in more than 2000 days.
Comment 15 Edwin Sharp 2013-09-16 12:16:26 UTC
As given in description.

Rev. 1522537 Debian