mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
Delete record related by a 1 to N relationship of a module with itself #4816
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#4816
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 @SinergiaCRM on GitHub (Jul 26, 2022).
Issue
When we have a 1 to N relationship between a module with itself and we relate two records through the relationship, if we delete the record indicated in the field generated by the relationship, the relationship is not deleted.
Later, editing and saving the undeleted record throws an error in the relationship field because the relationship was not deleted when the record it pointed to was deleted.
Saving the record can be done by clicking on the cross of the related field to indicate that it is no longer related, but in the next edition of the record the error occurs again
Expected Behavior
After deleting the record indicated by the field created by the relationship, as with 1 to N relationships between different modules, the relationship had to be deleted
Actual Behavior
After deleting the record indicated by the field created by the 1 to N relationship between the same modules, the relationship is not deleted.
Steps to Reproduce
Possible Fix
We think that:
The bug is related to the process of saving the 1 to N relationships between a module with itself: https://github.com/salesagility/SuiteCRM/blob/master/data/SugarBean.php#L2824-L2833
A solution might have to do with the getSide() function of the Link2 class: https://github.com/salesagility/SuiteCRM/blob/master/data/Link2.php#L306
Context
We think it is important since the CRM remains in a state of inconsistency and the error continues when saving the record is very inconvenient
Your Environment
SuiteCRM Version used: Version 7.12.6
Browser name and version: Versión 100.0.4896.88 (Build oficial) (64 bit
Environment name and version: MySQL, PHP 7
Operating System and version: Ubuntu 20.04