# Bug OP-17495 - PDF export fails if linked wp ID contains invalid letters

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-17495

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Modules and project features / Export / PDF Export |
| Target versions | 16.2.0 |
| Observed in versions | 16.1.0 |
| Sprint | 16.2.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 16.1.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable | Andrej Sandorf |
| Product manager |  |
| Developers | Andrej Sandorf |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Create a work package link in the description editor

2.  Go "view source"

3.  Add invalid content in to `<mention data-id="123" ... />` e.g. `<mention data-id="#123" .../>`

4.  Export to PDF

### What is the buggy behavior?

  - The PDF export fails with an error message.   
    This failure is particularly problematic during bulk "Report" exports, as the process terminates entirely instead of skipping the invalid identifier.

### What is the expected behavior?

1.  The invalid id is ignored and the PDF export continues

### **Logs**

<https://appsignal.com/openproject-gmbh/sites/673c529383eb67b55471dda2/exceptions/incidents/722/samples/673c529383eb67b55471dda2-848752493603098719217520540601>

``` text
The PDF export could not be saved: No route matches {action: "show", controller: "work_packages", id: "#32251"}, possible unmatched constraints: [:id]
```

### 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**

  - All

**OpenProject version**

**Browser**

  - All

**Operating System**

  - All

**Language**

  - All
