Skip to content

fix(#7594): prevent extra doc duplication when editing reports#11068

Open
shivv23 wants to merge 1 commit into
medic:masterfrom
shivv23:pr-7594-extra-docs-edit
Open

fix(#7594): prevent extra doc duplication when editing reports#11068
shivv23 wants to merge 1 commit into
medic:masterfrom
shivv23:pr-7594-extra-docs-edit

Conversation

@shivv23
Copy link
Copy Markdown

@shivv23 shivv23 commented May 14, 2026

Summary

When editing a report that created extra documents via [db-doc=true] in form XML, every edit created duplicate extra docs with new UUIDs while the original extra docs remained orphaned.

Changes

  • The private _save() method now accepts an isEdit parameter (true when editing, false when creating).
  • The xmlToDocs() method skips extra doc creation when isEdit is true, returning an empty array instead of generating new extra docs.
  • The hidden_fields list is still populated to correctly render the report view.
  • Previously created extra docs remain intact and unchanged.

This implements option (2) from the issue discussion: "Don't create additional docs when editing."

Testing

  • Manually verified that editing a report with [db-doc=true] fields no longer creates duplicate extra documents.
  • All existing webapp unit tests continue to pass.

When editing a report that created extra docs via [db-doc=true] in
form XML, every edit created duplicate extra docs with new UUIDs
while the original extra docs remained orphaned.

Fixed by skipping extra doc creation during report editing (isEdit=true).
The hidden_fields list is still populated to correctly render the
report view, but no new extra documents are generated. Previously
created extra docs remain intact and unchanged. This matches option
(2) from the issue discussion: 'Don't create additional docs when editing'.
@shivv23 shivv23 force-pushed the pr-7594-extra-docs-edit branch from e859bdf to fa8e0b6 Compare May 14, 2026 09:22
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.

1 participant