Skip to content

fix: resolve draw.io save failure on copied blocks (#2288) - #2297

Merged
Philipinho merged 1 commit into
docmost:mainfrom
Abhigyan-git09:fix/drawio-copy-paste-issue
Jun 20, 2026
Merged

Philipinho merged 1 commit into
docmost:mainfrom
Abhigyan-git09:fix/drawio-copy-paste-issue

Conversation

@Abhigyan-git09

Copy link
Copy Markdown
Contributor

Fixes #2288

Bug Description

Copying a draw.io block and pasting it onto a different page caused a silent save failure.
The paste handler (editor-paste-handler.tsx) was attempting to re-upload the draw.io attachment for the new page but incorrectly derived the file name from src.split("/").pop(). Because draw.io diagrams use cache-busting suffixes (e.g. diagram.drawio.svg?t=17000), the query string was saved as part of the file extension, causing subsequent saves to fail validation.

Fix

This strips the query parameters using src.split("?")[0] before extracting the filename, ensuring the attachment receives a valid .svg extension.

@CLAassistant

CLAassistant commented Jun 20, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Philipinho
Philipinho merged commit 2dc35fa into docmost:main Jun 20, 2026
@Philipinho

Copy link
Copy Markdown
Member

Thanks for contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Copied Draw.io block fails to save on a different page

3 participants