Created attachment 161266 [details] Screenshot showing mangled ISO 8601 DocReleasedDate field It is fairly common in environments where document version control is in place to want to set Custom document properties such as DocVersion or DocReleasedDate and use those fields in the document. Unfortunately the current version of LibreOffice Writer on Ubuntu 20.04 is mangling those to the point of not being able to use them. Please fix to Date field isn't changed to DateTime field with invalid data. To reproduce this bug: 1. Start from a blank document in Writer. Edit Document Properties and add a Custom property of DocReleasedDate and pick type Date (not DateTime) and select 2020-05-25 i.e. use an ISO 8601 standard date format. 2. Type This is a test. and add the field DocReleasedDate 3. Add a Header and type This is a header test. and add the field DocReleasedDate 4. SaveAs the file as DateTest.docx using Word 2007-365 .docx filter. 5. Re open the file and find the date format with garbage 0025-01-02 and custom property changed from Date to DateTime with invalid data. Version: 6.4.3.2 Build ID: 1:6.4.3-0ubuntu0.20.04.1 CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; Locale: en-CA (en_CA.UTF-8); UI-Language: en-US Calc: threaded
Ah well when I made the screenshot I actually used DocDateReleased instead of DocReleasedDate but the field name doesn't matter. It fails the same way no matter what you name the customer document property...
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided. (Please note that the attachment will be public, remove any sensitive information before attaching it. See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
Created attachment 161272 [details] Sample document showing failure mode Please note after you SaveAs in Word 2007-365 .docx format both the displayed fields are correct and when you look in Document properties the custom properties we added it still shows correctly as type Date. The problem arises when you close Writer and reopen the file that was saved. Then the date type document property gets mangled to DateTime format with the erroneous data and is displayed incorrectly. Please find attached a sample DateTest.docx document.
Attachment provides requested sample. Problem is displayed on FILEOPEN after a SaveAs of a new document.
(In reply to rhardy from comment #3) > Created attachment 161272 [details] > Sample document showing failure mode Thanks for the document. But please provide a odt-file (after step 3 of your steps to repoduce). This makes it possible to compare dte format before and after saving as docx. Thanks => NEEDINFO
Created attachment 161372 [details] DateTest2 screenshot Screenshot showing failure mode after DateTest2.docx file is opened.
Created attachment 161373 [details] DataTest2.odt file DateTest2.odt file with correct Custom Document Property DocDateReleased. This displays properly using ISO 8601 date format.
Created attachment 161374 [details] DateTest2.docx file Loaded DateTest2.odf and SaveAs DateTest2.docx using Word 2007-365 docx filter. Note when reopening the DataTest2.dox file shows a mangled Custom Document property and displays incorrectly. The DataTest2 screenshot uploaded previously shows this. It only happens after you close and reopen the DataTest2.docx file.
Comment on attachment 161374 [details] DateTest2.docx file I loaded DateTest2.odt and SaveAs DateTest2.docx using Word 2007-365 docx filter. Note when reopening the DateTest2.docx file it shows a mangled Custom Document property and displays dates incorrectly. The DateTest2 screenshot uploaded which shows this. It only appears in the UI after you close and reopen the DateTest2.docx file.
Provided updated files as requested.
I confirm it with Version: 7.0.0.0.beta1 (x64) Build ID: 94f789cbb33335b4a511c319542c7bdc31ff3b3c CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: en-GB Calc: CL Steps to reproduce 1. Open file from comment 7 2. File => Properties => Custom Properties => Type is "Date" 3. Save as docx 4. File => Properties => Custom Properties => Type is "Date" 5. Close and Reopen file in writer 6. File => Properties => Custom Properties => Type is "DateTime" Additional information: Can't open dock-file with Word 2016
The date in custom.xml is saved in different order by LibreOffice. It is saved: <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="3" name="DocReleasedDate"> <vt:filetime>20-10-2017T00:00:00Z</vt:filetime> </property> and it should be: <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="3" name="DocReleasedDate"> <vt:filetime>2017-10-20T00:00:00Z</vt:filetime> </property> After manual fixing everything is opening smoothly.
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f25f804b0009f026cfac665bb8ec03b4656d81fb tdf#133377 OOXML Fix storage of date in Custom Properties It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "libreoffice-7-0": https://git.libreoffice.org/core/commit/5dda71e33e8d7e5b6433b7c3b48115c6738a177f tdf#133377 OOXML Fix storage of date in Custom Properties It will be available in 7.0.3. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Commit Notification from comment #14) > It will be available in 7.0.3. I can still reproduce the problem with steps from comment 11 with Version: 7.0.3.1 (x64) Build ID: d7547858d014d4cf69878db179d326fc3483e082 CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: en-GB Calc: threaded
@Dieter(In reply to Dieter from comment #15) > (In reply to Commit Notification from comment #14) > > It will be available in 7.0.3. > > I can still reproduce the problem with steps from comment 11 with The issue from the bug description was already resolved. To reproduce the issue please follow steps: 1. Start from a blank document in Writer. Edit Document Properties and add a Custom property of DocReleasedDate and pick type Date (not DateTime) and select 2020-05-25 i.e. use an ISO 8601 standard date format. 2. Type This is a test. and add the field DocReleasedDate 3. Add a Header and type This is a header test. and add the field DocReleasedDate 4. SaveAs the file as DateTest.docx using Word 2007-365 .docx filter. 5. Re open the file and find the date format with garbage 0025-01-02 and custom property changed from Date to DateTime with invalid data.