mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
Workflow adds unwanted relationship if multiple relations #5141
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#5141
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 @gunnicom on GitHub (Jan 10, 2024).
Preconditions:
Module A
Module B
2 relations 1 to many from module A to module B ( module A got the fields, module B got the subpanels:
modA_modb_c
modA_modB_1_c
Relate object in Module A to Onject in Module B only on the first relationship modA_modb_c.
modA_modB_1_c stays empty.
Add a Workflow, on_save:
If condition in module A is met, change something in Module B
Open Object in EditView (not Inline Edit), and save with condition met.
Workflow will run, change what is to change in Module B,
BUT additionally it adds Module B as related in modA_modB_1_c
Does not happen in Inline Edit. Reasons explained in "What happened?"
What happened?
Saving module A sends following:
$REQUEST['relate_to']="ModuleA"
$ REQUEST['relate_id']="THEID"
The workflow runs ->save() (around 410 actionCreateRecord)
save runs save_relationship_changes (around 2369 SugarBean)
set_relationship_info() gets called
set_relationship_info gets beans to relate to from above $_REQUEST
So setting relation to the wrong relationship.
Expected Behavior
Workflow does not add the additional relationship
Actual Behavior
See above "What happens".
Possible Fix
Set not_use_rel_in_req to true before save in workflow, so REQUEST variables wont be used to create a relationship.
Steps to Reproduce
See on Top
Your Environment