fix(#7594): prevent extra doc duplication when editing reports#11068
Open
shivv23 wants to merge 1 commit into
Open
fix(#7594): prevent extra doc duplication when editing reports#11068shivv23 wants to merge 1 commit into
shivv23 wants to merge 1 commit into
Conversation
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'.
e859bdf to
fa8e0b6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
_save()method now accepts anisEditparameter (truewhen editing,falsewhen creating).xmlToDocs()method skips extra doc creation whenisEditistrue, returning an empty array instead of generating new extra docs.hidden_fieldslist is still populated to correctly render the report view.This implements option (2) from the issue discussion: "Don't create additional docs when editing."
Testing
[db-doc=true]fields no longer creates duplicate extra documents.