Bug 131127 - FILESAVE: Form: incorrect "time" type
Summary: FILESAVE: Form: incorrect "time" type
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: odf odf_validation
Keywords: preBibisect, regression
Depends on:
Blocks: Form-Controls
  Show dependency treegraph
 
Reported: 2020-03-04 15:16 UTC by Xisco Faulí
Modified: 2024-02-04 07:26 UTC (History)
7 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 Xisco Faulí 2020-03-04 15:16:16 UTC
Steps to reproduce:
1. Open writer
2. Insert a time form
3. Exit design mode
4. Write 12:12 ( or any other value ) in the form
5. Save
6. Check the file in https://odfvalidator.org/ or check content.xml

-> form:current-value is PT12H12M, which is a valid ISO 8601 syntax for *durations*. *time* is expected [1] [2] [3]

[1] http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1718338_1219268628
[2] https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#time
[3] https://en.wikipedia.org/wiki/ISO_8601 

Issue found while working on a unittest for bug 130515. See discussion: https://gerrit.libreoffice.org/c/core/+/89895

Reproduced in

Version: 7.0.0.0.alpha0+
Build ID: c57d6d39c80844c9d4c6bfed85cc151e52a67b34
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 1 Xisco Faulí 2020-03-04 15:17:34 UTC
Reproduced back to

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)

but not in

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 2 Lionel Elie Mamane 2020-03-05 09:45:35 UTC
This smells like it could have been introduced by the changes done around the incompatible API/ABI change we had around the time of 4.1 (introduction of nanosecond precision in times). I might have done it consciously, without realising the consequences on ODF compliance, because time controls are (or I thought they could be) (ab)used for duration fields in databases (and thus can overflow 24h).

Whoever wants to investigate this can look at these candidates:

commit f5c7e770314826c121fb6a03d56f424d308e1e2f
Author: Lionel Elie Mamane <lionel@mamane.lu>
Date:   Wed Feb 5 16:53:10 2014 +0100

commit 8ee69b0ba13f74d1515fac71df92947eb6328ab1
Author: Lionel Elie Mamane <lionel@mamane.lu>
Date:   Sun Aug 4 01:14:22 2013 +0200

commit f4cadd9772ed0ff6e7f7b170080f90384d1f2318
Author: Lionel Elie Mamane <lionel@mamane.lu>
Date:   Sat Aug 3 11:05:21 2013 +0200

commit ed904af8665f6f7590fedd4ad608018f78c686c1
Author: Lionel Elie Mamane <lionel@mamane.lu>
Date:   Sun Jul 28 16:08:26 2013 +0200

commit 202d45cff25492bb4d7f550df5c368af097d2e0c
Author: Lionel Elie Mamane <lionel@mamane.lu>
Date:   Fri Apr 19 07:14:48 2013 +0200

commit 81cf58f191f57b3cfad08f5c7d622b30f7fc72d9
Author: Lionel Elie Mamane <lionel@mamane.lu>
Date:   Fri Apr 19 07:14:23 2013 +0200

commit f805afcf4c3056feb1690393d907442cf337b484
Author: Lionel Elie Mamane <lionel@mamane.lu>
Date:   Thu Apr 18 23:00:07 2013 +0200

commit 9830fd36dbdb72c79703b0c61efc027fba793c5a
Author: Lionel Elie Mamane <lionel@mamane.lu>
Date:   Sun Mar 17 08:36:26 2013 +0100
Comment 3 Xisco Faulí 2020-03-05 09:53:58 UTC
Setting to NEW and bibisected based on comment 2
Comment 4 Lionel Elie Mamane 2020-03-05 16:00:20 UTC
(In reply to Xisco Faulí from comment #3)
> Setting to NEW and bibisected based on comment 2

"smells like" means it is my guess, and here are pointers. But that is just an educated guess. A bibisect would be far more definitive. Setting back to bibisectRequest.
Comment 5 Aron Budea 2020-03-09 01:39:04 UTC
In 3.4.0.1 and in oldest commit of bibisect-43all, the validation error message is already there, though slightly different:
1time.odt/content.xml[2,4116]: Error: attribute "form:current-value" has a bad value: "PT12H12M00S" does not satisfy the "time" type PT23H59M59.99S" form:validation="true">

In 3.5.0.3 the error message is:
1time.odt/content.xml[2,4284]: Error: attribute "form:current-value" has a bad value: "PT12H12M" does not satisfy the "time" type PT23H59M59.99S" form:validation="true">

After the first commit in comment 2's commit list (in bibisect-41max), the error message is:
1time.odt/content.xml[2,4286]: Error: attribute "form:current-value" has a bad value: "P0D" does not satisfy the "time" type PT2.086692451S" form:validation="true">

This probably changes in later commits, I'm assuming there's no point in checking those.

=> Setting keyword preBibisect.
Comment 6 Lionel Elie Mamane 2020-03-09 07:48:13 UTC
The error messages in comment 5 (for versions 3.4 and 3.5) suggest that the issue is not one of XMLSchema 2 time datatype vs XMLSchema 2 duration datatype, but that the validator expects a duration, but with all elements written out, down to centiseconds, while the file contains only the elements actually present and non-zero.

I mean, the error message looks like it wants PT12H12M00.00S instead of PT12H12M00S or PT12H12M.

Is that because LibO 3.4 and 3.5 issue a different ODF version, and that part of the specification has changed?

I see in the ODF spec (both 1.0 and 1.2) that an office:time-value must be coded as an XMLSchema 2 *duration*, not *time*. That doesn't seem to apply to form:current-value, though. Why the difference, I'm not sure.
Comment 7 Michael Stahl (allotropia) 2022-02-03 18:40:02 UTC
looks like OOo 3.3 saved it as this also invalid variant:

form:current-value="12120000"

in OOo 3.4 beta it is:

form:current-value="PT12H12M00S"

there are actually 2 wrong attributes

form:current-value="PT12H12M00S" form:max-value="PT23H59M59.99S" 

or even 4 maybe, form:value and form:min-value aren't written by default but also have type "time"
Comment 8 QA Administrators 2024-02-04 03:14:02 UTC
Dear Xisco Faulí,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug