Bug 1360651

Summary: [PATCH] Fix rst2odt generates ODT docs show 1st and 2nd images only
Product: [Fedora] Fedora Reporter: Satoru SATOH <ssato>
Component: python-docutilsAssignee: Fedora Infrastructure SIG <infra-sig>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 26CC: infra-sig, kevin
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-23 15:32:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
An experimental pathc to make rst2odt generates unique draw:name attribute for each image elements
none
A test file
none
Another experimental pathc to make rst2odt generates unique draw:name attribute for each image and figure elements
none
Another experimental pathc to make rst2odt generates unique draw:name attribute for each image and figure elements (2) none

Description Satoru SATOH 2016-07-27 09:00:35 UTC
Created attachment 1184545 [details]
An experimental pathc to make rst2odt generates unique draw:name attribute for each image elements

Description of problem:
It seems that rst2odt does not generate unique draw:name attribute for
each images embedded with '.. image::' or '.. figure::' directives,
and that causes strange problem that only 1st and 2nd images are shown
in generated ODT document.

I'll attach a simple test case found at [1] and an experimental fix
for this issue.


[1] http://stackoverflow.com/questions/36766905/rst2odt-not-showing-the-third-image
[2] https://bugs.documentfoundation.org/show_bug.cgi?id=96245


Version-Release number of selected component (if applicable):
python-docutils-0.12-0.6.20140510svn7747

How reproducible: Always


Steps to Reproduce:
1. Create test.rst (or download test.rst I'll attach)
2. rst2odt test.rst test.odt (build ODT file)
3. libreoffice test.odt (check)

Actual results:
test.odt only show 1st and 2nd images.

Expected results:
test.odt should show 3rd image also.

Additional info:
I guess that root causes is that rst2odt generates static const draw:name
attribute. I changed that and got expected results successfully.

Comment 1 Satoru SATOH 2016-07-27 09:01:39 UTC
Created attachment 1184546 [details]
A test file

Comment 2 Satoru SATOH 2016-07-27 09:04:07 UTC
Related RPMs: libreoffice-writer-5.1.5.1-2.fc24.x86_64, unoconv-0.7-3.fc24.noarch

Also https://bugs.documentfoundation.org/show_bug.cgi?id=96245 may be related.

Comment 3 Satoru SATOH 2017-02-07 09:07:15 UTC
It seems that this very annoying problem still exists in the latest one, python-docutils-0.12-0.7.20140510svn7747.fc25.noarch and also found in the upstream latest svn code.

I attached another experimental patch looks resolving this later.

Comment 4 Satoru SATOH 2017-02-07 09:08:40 UTC
Created attachment 1248317 [details]
Another experimental pathc to make rst2odt generates unique draw:name attribute for each image and figure elements

Comment 5 Satoru SATOH 2017-02-07 09:16:53 UTC
FYI. I reported this issue to the upstream also: https://sourceforge.net/p/docutils/bugs/306/

Comment 6 Satoru SATOH 2017-02-13 06:12:17 UTC
Created attachment 1249751 [details]
Another experimental pathc to make rst2odt generates unique draw:name attribute for each image and figure elements (2)

Almost same with the previous patch but made it applicable to python2-docutils-0.13.1-3.fc25.noarch.

Comment 7 Fedora End Of Life 2017-02-28 10:00:47 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 8 Kevin Fenzi 2017-10-22 19:32:45 UTC
Sorry this has languished so long. ;( 

I just build 0.14 in rawhide. I think it contains your patch. Do you need an update for stable releases? and can you confirm it's fixed in 0.14?

Comment 9 Satoru SATOH 2017-10-23 01:16:23 UTC
Sorry, I forgot to let you know about that. My patch was merged in the upstream, https://sourceforge.net/p/docutils/bugs/306/, so it's safe to close this.

Comment 10 Kevin Fenzi 2017-10-23 15:32:07 UTC
Great. Let us know if you need any stable updates or the like.