Bug 65436 - Wrong behavior observed when modifiying a custom property in an MS Word 2003 .doc file (Using POI 4.0.1) after the same custom property was earlier modified using POI 3.15
Summary: Wrong behavior observed when modifiying a custom property in an MS Word 2003 ...
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: unspecified
Hardware: PC All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-06 10:09 UTC by pankajs
Modified: 2021-07-22 12:40 UTC (History)
0 users



Attachments
This contains the code referred in this bug and the attached video (13.14 KB, application/x-zip-compressed)
2021-07-06 10:09 UTC, pankajs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pankajs 2021-07-06 10:09:57 UTC
Created attachment 37946 [details]
This contains the code referred in this bug and the attached video

Steps to reproduce
-------------------

1. Create an MS Word 2003 .doc file and name it as test.doc. 
2. In the test.doc file create a text custom property "r_version_label". Give it a value 0.2
3. Using POI 3.15 library modify this custom property and give it a value of 0.3 (Java program attached "Test_POI_315.java" inside test-poi.zip)
	- Modify the dependency in the pom.xml to use poi 3.15 library
4. Using POI 4.0.1 library modify the custom property again and give it a value 0.4 (Java program attached "Test_POI_401.java" inside test-poi.zip)
	- Modify the dependency in the pom.xml to use poi 4.0.1 library
5. Then open the file and view its custom property value.

Expected Result 
- The custom property value should be 0.4 

Actual Result
- The custom property value is 0.


Attachments
1. test-poi.zip (contains pom.xml to switch between poi 3.15 and 4.0.1, one java program to use for each version. Two programs created as there is an API difference between the two versions)
2. Screen-recording demonstrating the same behavior.
Comment 1 pankajs 2021-07-06 10:18:32 UTC
I am unable to upload the video file since it is crossing the file size limitation, so I have uploaded it on YouTube. 

https://www.youtube.com/watch?v=GuwhZ-ApFbE&t=40s
Comment 2 PJ Fanning 2021-07-06 10:32:39 UTC
We don't support POI 3.15 any more - can you try this with POI 5.0.0?
Comment 3 pankajs 2021-07-06 11:00:55 UTC
Thanks for replying. I will surely try this with 5.0.0 (in place of 4.0.1). 

But the issue is that we have millions of documents whose custom properties were modified with apache poi 3.15 and now after upgrading the poi to 4.0.1 all those documents have started mis-behaving. 

Please suggest a way out.
Comment 4 pankajs 2021-07-06 11:06:01 UTC
Tested with POI 5.0.0. Same behavior is observed.
Comment 5 pankajs 2021-07-22 08:45:04 UTC
Hi, 
Could some one please help with this issue. Please provide me some suggestions or pointers as a work around to this issue. 

Thanks,
Pankaj
Comment 6 PJ Fanning 2021-07-22 12:40:40 UTC
Have you tried the example - https://github.com/apache/poi/blob/trunk/poi-examples/src/main/java/org/apache/poi/examples/hpsf/ModifyDocumentSummaryInformation.java ?

I just tried this with POI 5.0.0 and it works as expected.
Comment 7 PJ Fanning 2021-07-22 12:40:54 UTC
Have you tried the example - https://github.com/apache/poi/blob/trunk/poi-examples/src/main/java/org/apache/poi/examples/hpsf/ModifyDocumentSummaryInformation.java ?

I just tried this with POI 5.0.0 and it works as expected.