Content
View differences
Updated by Andrej Sandorf 9 months ago
### Before filing a report
_Before you file a report, please ensure you are running the latest version of OpenProject and_
_have searched for similar bug reports._
### Steps to reproduce
To reproduce this error, you need to have one image available on your local file system, I will call this file _example.png_ in this bug description.
1. Create a new work package.
2. Edit the work package description and insert the image _example.png_ from your local file system into the description \[a\].
3. Export PDF - you should see the image displayed in the export.
4. Enter the work package description edit mode and add a new line "Here comes the same image as before, but it won't show" and add a paragraph at the bottom.
5. Drag and drop _example.png_ from the _Files_ tab into the work package description at the bottom \[b\].
6. Save the work package description - you should now see the image twice. It is the very same file.
7. Export PDF - the image is only shown once, \[a\] is shown, but \[b\] is not.
### What is the buggy behavior?
Images inserted from local file system are correctly shown in PDF export, but images which were attached to the work package and then added to work package details are not visible in PDF export. export.
Opening the work package description markdown source reveals that image src path is different.
image \[a\] is linked via API: API:
```text
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/1297/content">
```
image \[b\] is "hard-linked": "hard-linked":
```text
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/attachments/1297/example.png"></div></figure>
```
Manually editing image \[b\] src attribute to the API link solves the issue: issue:
```text
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/1297/content"></div></figure>
```
Although the bug becomes evident in PDF export, the src path seems to be the root cause. It seems the attached image is hard-linked whereas the uploaded image is linked via API allowing the OpenProject API to evaluate permissions to view the attachment which might be needed for PDF generation. generation.
The bug might be fixed in the drag and drop functionality rather than the PDF export function. function.
### What is the expected behavior?
Images which have been attached to the work package should be shown in the exported PDF the same way they are shown in the work package details. details.
### Important note
_Please note that unless you are a contributor to OpenProject, you can no longer edit this bug report after saving. You can still add new comments, new images and upload attachments though, but updating description or modifying fields will not be possible after saving. Please make sure that all necessary information and attachments are added, and the following attributes are set:_
### **Logs**
_Are there errors in the browser console? (_[_Click here for information on how to open your browser's console_](https://webmasters.stackexchange.com/a/77337)_) For a local installation: Are there relevant logs output by_ `_openproject logs_` _(packaged installation) (_[_click here for details_](https://docs.openproject.org/installation-and-operations/operation/monitoring/#show-logs)_) or in a log/production.log or /var/log/openproject/ ? Please attach error output in these log files if applicable_
### Screenshots and other files
_If you have screenshots of the application's bug behavior or other relevant files, please drag them into this place or attach them using the "Files" section._
### Environment information
_Please check and fill out the following details to help us identify in what versions and distributions of OpenProject the error occurs_
**OpenProject installation type**
* Hosted cloud edition
**Browser**
* [ ] Chrome
* [x] Firefox
* [ ] Safari
* [ ] Mobile Safari
* [ ] Other (please specify)
**Operating System**
* [x] Windows
* [ ] Mac OS X
* [ ] Mobile iOS
* [ ] Mobile Android
* [ ] Linux (please specify distro)
* [ ] Chrome OS
* [ ] Other (please specify)
**Language**
_EN_
_Before you file a report, please ensure you are running the latest version of OpenProject and_
_have searched for similar bug reports._
###
2. Edit the work package description and insert the image _example.png_ from your local file system into the description \[a\].
3. Export PDF - you should see the image displayed in the export.
4. Enter the work package description edit mode and add a new line "Here comes the same image as before, but it won't show" and add a paragraph at the bottom.
5. Drag and drop _example.png_ from the _Files_ tab into the work package description at the bottom \[b\].
6. Save the work package description - you should now see the image twice. It is the very same file.
7. Export PDF - the image is only shown once, \[a\] is shown, but \[b\] is not.
### What is the buggy behavior?
Images inserted from local file system are correctly shown in PDF export, but images which were attached to the work package and then added to work package details are not visible in PDF export.
Opening the work package description markdown source reveals that image src path is different.
image \[a\] is linked via API:
```text
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/1297/content">
```
image \[b\] is "hard-linked":
```text
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/attachments/1297/example.png"></div></figure>
```
Manually editing image \[b\] src attribute to the API link solves the issue:
```text
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/1297/content"></div></figure>
```
Although the bug becomes evident in PDF export, the src path seems to be the root cause. It seems the attached image is hard-linked whereas the uploaded image is linked via API allowing the OpenProject API to evaluate permissions to view the attachment which might be needed for PDF generation.
The bug might be fixed in the drag and drop functionality rather than the PDF export function.
### What is the expected behavior?
Images which have been attached to the work package should be shown in the exported PDF the same way they are shown in the work package details.
###
_Please note that unless you are a contributor to OpenProject, you can no longer edit this bug report after saving. You can still add new comments, new images and upload attachments though, but updating description or modifying fields will not be possible after saving. Please make sure that all necessary information and attachments are added, and the following attributes are set:_
### **Logs**
_Are there errors in the browser console? (_[_Click here for information on how to open your browser's console_](https://webmasters.stackexchange.com/a/77337)_) For a local installation: Are there relevant logs output by_ `_openproject logs_` _(packaged installation) (_[_click here for details_](https://docs.openproject.org/installation-and-operations/operation/monitoring/#show-logs)_) or in a log/production.log or /var/log/openproject/ ? Please attach error output in these log files if applicable_
### Screenshots and other files
_If you have screenshots of the application's bug behavior or other relevant files, please drag them into this place or attach them using the "Files" section._
###
_Please check and fill out the following details to help us identify in what versions and distributions of OpenProject the error occurs_
**OpenProject installation type**
* Hosted cloud edition
**Browser**
* [ ] Chrome
* [x] Firefox
* [ ] Safari
* [ ] Mobile Safari
* [ ] Other (please specify)
**Operating System**
* [x] Windows
* [ ] Mac OS X
* [ ] Mobile iOS
* [ ] Mobile Android
* [ ] Linux (please specify distro)
* [ ] Chrome OS
* [ ] Other (please specify)
**Language**
_EN_