mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
New cases display orphaned case attachments #5055
Labels
No labels
Area: API
Area: Campaigns
Area: Cases
Area: Clean Up
Area: Clean Up: Performance
Area: Dashlets
Area: Databases
Area: Developer Tools
Area: Elasticsearch
Area: Elasticsearch
Area: Emails
Area: Emails:Campaigns
Area: Emails:Cases
Area: Emails:Compose
Area: Emails:Config
Area: Emails:Templates
Area: Environment
Area: Installation
Area: Language
Area: Mobile
Area: Module
Area: PDFs
Area: PHP8
Area: Reports
Area: Studio
Area: Styling
Area: Upgrading
Area: Workflow
Area:Activity Stream
Area:Calls
Area:Import
Area:Projects
Area:Search
Area:Surveys
Area:Themes
Area:Users
Branch:Hotfix
Good First Issue
Hacktoberfest
Help Wanted
PR:Community Contribution
PR:Type:Enhancement
Priority:Critical
Priority:Important
Priority:Moderate
Severity: Major
Severity: Minor
Severity: Moderate
Status: Requires Code Review
Status: Requires Updates
Status: Stale
Status: Team Investigating
Status:Assessed
Status:Fix Proposed
Status:Needs Assessed
Status:Requires Automated Tests
Type: Bug
Type:Deprecated
Type:Discussion
Type:Duplicate
Type:Invalid
Type:Question
Type:Suggestion
Type:Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SuiteCRM-SuiteCRM#5055
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ojs87 on GitHub (Aug 21, 2023).
Issue
When a Cases record with Notes related to it is deleted, the orphaned notes will be loaded into the Case Attachements field when creating a new Cases record.
This causes a display bug on the Create Case view
Expected Behavior
If a Case has no id yet on the edit view, no Case Attachments should be loaded
Actual Behavior
Orphaned Case Attachments are displayed in the Case Attachments field
Possible Fix
in the display_case_attachments function in Case_Updated.php, return if the $case->id is empty
Steps to Reproduce
Your Environment
@johnM2401 commented on GitHub (Aug 30, 2023):
Hey!
I've given this a try in 7.14, but I'm not sure if I can replicate
OOTB, when creating a new Case, the "Case Attachments"/"Case Updates" fields don't show on the Editview
Do you know if you perhaps need any customizations to Cases for this?
After following the steps above, (and adding the Case Attachments/Updates fields to editview), it shows as following after Deleting a Case->Creating a new case:

Do you maybe have some more steps to help replicate this?
Thanks!
@ojs87 commented on GitHub (Sep 7, 2023):
Hi @johnM2401,
Thanks for testing that, sorry my steps were not as comprehensive as they should have been.
There has to be a note with an attachment added to a Case before deleting it, if the note doesn't have an attachment it doesn't show the link.
So the easiest way to recreate this is to just create a Note, relate to a Case with no Case selected, and upload a random image/file to the Note.
You can also relate it to a Case and then delete the case, which is how this issue first arose.
This should then show the orphaned link on the Create Case view.
Thanks