Mantis Bugtracker 

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002721TestLinkReportspublic2009-07-13 16:042011-03-16 22:19
Assigned To 
PlatformOSOS Version
Product Version1.8.3 
Fixed in Version 
Summary0002721: The different URL for images (UPLOADED ON FCKEDITOR) of Test Report with the format of HTML and MS Word
DescriptionLots of users have mentioned the problem of can not display the images of HTML or MS Word or both, and somebody gives some methods to try to solve it.

But today when I save the MS Word in the same dir of upload dir in Server and the images are visable in word(2003 and 2007), but I find out that the URL for images for images of HTML is different from MS Word: (assume the images upload URL is "lib/result/testlink_upload" and save the doc in the dir "lib/result")
    HTML is: http://Server_ip_address:port/lib/results/testlink_upload/$image_name [^]
    MS Word is:file:///C:\Program [^] Files\Apache Software Foundation\Apach2.2\htdocs\testlink\lib\result\testlink_upload\$image_name.

This will not be useful to see the images when save the MS Word in the computer of Client though the images are visable in HTML.

So anyboy can explain this and tell me how to settle it when using in Client.
TagsNo tags attached.
Database (MySQL,Postgres,etc)
PHP Version
QA Team - Task Workflow Status
Attached Fileszip file icon [^] (20,382 bytes) 2010-10-15 14:11

- Relationships
duplicate of 0002647closedfman Testplan printout into MS-Word is without images. 

-  Notes
mhavlat (reporter)
2009-07-14 03:47

That's msword problem.
Check: [^] [^] [^]

Can you try to add VBSCRIPT to end of generated document?
   For Each oField In ActiveDocument.Fields
      If oField.Type = wdFieldIncludePicture Then
          oField.LinkFormat.SavePictureWithDocument = True
      End If

I'm not sure if msword can handle if vba script is added at the end of html (so images are already loaded) or can be used <body> trigger event onLoad().
The first case: edit lib/functions/
function renderEof()
    return "\n</body>\n</html>";

Let me know your result. I'm linux users ... so I cannot test it.
mehrich (reporter)
2010-10-15 14:11

I don't think that this is a msword problem. The same problem is visible with OpenOffice Writer.

The main cause is the relative paths for images uploaded with fckeditor.

I have attached a fix.
With that fix the fields which can contain embedded images are modified before printing so that the relative paths are converted to absolute paths to the images.

As part of the solution I had to split the function get_home_url() in configCheck.php in 2 parts: get_home_url() and get_server_url() because for the absolute paths I need only the server url.

@developers: the attached fix contains already the decribed second fix in the issue 3804 (note 0011919) which also concerns images in reports.
tino (reporter)
2011-02-18 16:40

the attached fix is replacing src=" with src=" [^]
but if any image is stilt linked with the full domain path this fix cause:

src="http://www.example.com [^]

You can prevent this by replacing src="/ with src=" [^] (slash at the end). You can find my "Quick & Dirty" (but working) Solution in the Forum: [^]

Regards Tino

- Issue History
Date Modified Username Field Change
2009-07-13 16:04 Reaper New Issue
2009-07-14 03:47 mhavlat Note Added: 0007532
2009-07-14 03:47 mhavlat Status new => feedback
2009-07-14 03:47 mhavlat Severity major => tweak
2009-07-14 03:52 mhavlat Relationship added duplicate of 0002647
2010-10-15 14:11 mehrich Note Added: 0011921
2010-10-15 14:11 mehrich File Added:
2010-11-06 14:44 fman Summary The different URL for images of Test Report with the format of HTML and MS Word => The different URL for images (UPLOADED ON FCKEDITOR) of Test Report with the format of HTML and MS Word
2011-02-18 16:40 tino Note Added: 0013675

Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker