mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
If I duplicate a meeting and I edit it, changing the date and the assigned user = the calendar shows me the duplicate metting 2 times #5017
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#5017
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 @Rascott33 on GitHub (May 19, 2023).
Duplicating meetings is a wonderful feature when meetings are repeated over time, but I found a bug.
Duplicate and edited visits by changing the assigned user are repeated in the calendar.
Expected Behavior
If I create new visits using the duplicate visit function and change the date and assignee, the new duplicate visit must be a unique record for that assignee.
Actual Behavior
Duplicate visits that are edited and the assigned user is changed keep a memory of the assigned user to which it previously belonged and in the visits calendar if we see the shared month and see the visits of all users, that duplicate visit is shown repeatedly as many times as assigned users to which it belonged at some point.
Steps to Reproduce
If you were to duplicate the same meeting again and assign it to another user, it would show up on the calendar 3 times.
And so to infinity and beyond.
Context
Repeatedly displaying a single meeting record on the calendar can cause confusion.
Duplicate meetings with user switch should only be seen once for only the current assignee.
Your Environment
@SuiteBot commented on GitHub (May 19, 2023):
This issue has been mentioned on SuiteCRM. There might be relevant details there:
https://community.suitecrm.com/t/bug-v-7-13-duplicate-meeting-i-change-the-assigned-user-and-the-calendar-shows-me-double/89060/2
@pgorod commented on GitHub (May 20, 2023):
Exactly which PHP 7 are you using?
@Rascott33 commented on GitHub (May 20, 2023):
7.4.29
@Rascott33 commented on GitHub (May 22, 2023):
Investigating and discovered that in the "meetings_users" table when you duplicate a meeting and change the assigned user, two records are created in this table, one with the id of the initial user and another identical record but with the id of the new assigned user.
This is what generates duplication in the registration in the calendar. The record in the "meetings_users" table should only be 1 with the actual user assigned.
@Rascott33 commented on GitHub (May 22, 2023):
I’ve managed to modify the snippet so that duplicating meetings and changing the assigned user doesn’t create double calendar entries:
Go to modules/Meetings/MeetingFormBase.php and modules/Calls/CallFormBase.php and all this code:
//add assigned user and current user if this is the first time bean is saved
if (empty($focus->id) && !empty($_REQUEST['return_module']) && $_REQUEST['return_module'] =='Meetings' && !empty($_REQUEST['return_action']) && $_REQUEST['return_action'] =='DetailView') {
//if return action is set to detail view and return module to meeting, then this is from the long form, do not add the assigned user (only the current user)
//The current user is already added to UI and we want to give the current user the option of opting out of meeting.
//add current user if the assigned to user is different than current user.
if ($current_user->id != $_POST['assigned_user_id']) {
$_POST['user_invitees'] .= ','.$_POST['assigned_user_id'].', ';
$_POST['user_invitees'] = str_replace(',,', ',', $_POST['user_invitees']);
}
} elseif (empty($focus->id)) {
//this is not from long form so add assigned and current user automatically as there is no invitee list UI.
//This call could be through an ajax call from subpanels or shortcut bar
if (!isset($_POST['user_invitees'])) {
$_POST['user_invitees'] = '';
}
Change it for this:
//add assigned user and current user if this is the first time bean is saved
if (empty($focus->id) && !empty($_REQUEST['return_module']) && $_REQUEST['return_module'] =='Meetings' && !empty($_REQUEST['return_action']) && $_REQUEST['return_action'] =='DetailView') {
//if return action is set to detail view and return module to meeting, then this is from the long form, do not add the assigned user (only the current user)
//The current user is already added to UI and we want to give the current user the option of opting out of meeting.
//add current user if the assigned to user is different than current user.
if ($current_user->id != $_POST['assigned_user_id']) {
$_POST['user_invitees'] = str_replace(',,', ',', $_POST['assigned_user_id']);
}
} {
It destroys the invitations function, but for me it is a solution since I don't use it and seeing double entries in the calendar is very annoying