mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
Surveys - Deleting records from related modules in cascade #4786
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#4786
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 (Jun 17, 2022).
The Surveys module has several related module that are totally dependent from it. When deleting a Survey, none of the related records are deleting, leaving them orphans, with deleted=0 in the database. These might cause confusion if other tools are using the information directly from the database.
Issue
Orphans records remain when deleting surveys
Expected Behavior
Records should be deleted if they won't be used in any case
Actual Behavior
Orphan records remain unused
Possible Fix
We propose to override the function mark_deleted in each module bean and apply certain logic.
Modules involved:
1 - Surveys (It can be accessed from the UI)
2 - SurveyQuestions
3 - SurveyQuestionOptions
4 - SurveyResponses (It can be accessed from the UI)
5 - SurveyQuestionResponses
When deleting a record from a module, they should be deleted in cascade the records from the next modules:
Steps to Reproduce
Context
This can pollute the database.
Your Environment
SuiteCRM Version used: Version 7.12.6
Browser name and version: Chrome Versión 100.0.4896.88 (Build oficial) (64 bits), Firefox 100.0
Environment name and version: MySQL, PHP 7.4
Operating System and version: Ubuntu 20.04
@samus-aran commented on GitHub (Jul 6, 2022):
@SinergiaCRM Should there be an option and/or disclaimer to allow the user to choose upon deleting the Survey? I understand your perspective that there is no reason to have these related sub-records. I'm just interested if we do this for other interlinked relationships e.g. Projects + Project Tasks or Workflows + Workflow Actions, Quotes + Line items.