Skip to content

Conversation

@as-op
Copy link
Contributor

@as-op as-op commented Dec 4, 2025

Ticket

https://community.openproject.org/work_packages/69625

What are you trying to achieve?

A custom font file is uploaded, but its storage is broken.
Instead of a pointless The PDF export could not be saved: undefined method 'body' for nil message, the export should continue without the font applied.

What approach did you choose and why?

  • Cleaned up error handling in all PDF exports, as stacktrace was swallowed due to re-raising with a different exception message.
  • Catch a possible storage error (occurred in simply calling CustomStyle.current.export_font_regular.local_file.present?)
  • Check all other font cuts - bold, italic, bold_italic, if present

Merge checklist

  • Added/updated tests
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@as-op as-op force-pushed the bug/69625-error-in-pdf-exports-if-font-file-is-damaged-or-storage-is-broken branch from 541ff11 to c015499 Compare December 4, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants