Fix attachment path resolution for deeply nested compositions - #574
Closed
PujaDeshmukh17 wants to merge 1 commit into
Closed
Fix attachment path resolution for deeply nested compositions#574PujaDeshmukh17 wants to merge 1 commit into
PujaDeshmukh17 wants to merge 1 commit into
Conversation
Contributor
|
👋 Hi — I'm PR Bot, your SAP code review assistant. I'll automatically review your pull requests for code quality, security, and SAP compliance. Get an overview of what I do → What I do
Key commands
Configure me for your teamCreate {
"$schema": "https://devops-insights-pr-bot.cfapps.eu10-004.hana.ondemand.com/schema/pull_request_bot.json",
"features": {
"control_panel": false,
"summarize": {
"auto_generate_summary": true,
"auto_insert_summary": true,
"auto_run_on_draft_pr": true,
"use_custom_summarize_prompt": false,
"use_custom_summarize_output_template": false,
"excluded_paths": [],
"auto_exclude_authors": []
},
"review": {
"auto_generate_review": true,
"auto_run_on_draft_pr": false,
"use_custom_review_focus": false,
"excluded_paths": [],
"auto_exclude_authors": []
},
"sonar_fix": {
"enable": true,
"excluded_rules": []
},
"pipeline_fix": {
"enable": true
}
},
"excluded_paths": []
}*This introduction message will be shown to you only once, you will not see it in future PRs. |
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
Fixed an upload issue where attachment path mappings were incorrectly resolved for entities with deeply nested compositions (e.g., Entity → Sections → attachments)
Introduced recursive path traversal (findPathToEntity) to correctly build the actual upload path when an attachment belongs to an intermediate entity rather than the direct target entity
Updated buildActualPath to accept targetEntity and distinguish between direct and nested attachment ownership before constructing the path
Updated buildEntityPath to use the attachmentPath as-is for nested attachments, ensuring uniqueness at any composition depth
Root Cause
The previous logic always built the actual path using parentEntity + compositionPropertyName + attachmentPart, which was incorrect when the attachment was owned by an intermediate composition (not the direct target entity). This caused path mismatches during upload.
Type of change
Please delete options that are not relevant.
Checklist before requesting a review
Upload Screenshots/lists of the scenarios tested