date_end of calls is not stored correctly in the database #4979

Open
opened 2026-02-20 16:27:17 -05:00 by deekerman · 0 comments
Owner

Originally created by @QuickCRM on GitHub (Mar 17, 2023).

date_end of calls is stored as date_start if duration_hours is 0 or duration_minutes is 0

Issue

Expected Behavior

date_end should depend on duration

Actual Behavior

date_end = date_start in the database

Possible Fix

in Calls save function, replace
if (!empty($this->duration_hours) && !empty($this->duration_minutes)) {
by
if (!empty($this->duration_hours) || !empty($this->duration_minutes)) {

Steps to Reproduce

  1. Create a call with duration = 15mn
  2. Look at that call in the database
  3. date_end is equal to date_start

Context

Your Environment

  • SuiteCRM Version used: 7.12.10
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): any
  • Environment name and version (e.g. MySQL, PHP 7): PHP 7.4
  • Operating System and version (e.g Ubuntu 16.04):
Originally created by @QuickCRM on GitHub (Mar 17, 2023). <!--- Provide a general summary of the issue in the **Title** above --> date_end of calls is stored as date_start if duration_hours is 0 or duration_minutes is 0 <!--- Before you open an issue, please check if a similar issue already exists or has been closed before. ---> <!--- If you have discovered a security risk please report it by emailing security@suitecrm.com. This will be delivered to the product team who handle security issues. Please don't disclose security bugs publicly until they have been handled by the security team. ---> <!--- Please be aware that as of the 31st January 2022 we no longer support 7.10.x. New issues referring to 7.10.x will only be valid if applicable to 7.12.x and above. If your issue is still applicable in 7.12.x, please create the issue following the template below --> #### Issue <!--- Provide a more detailed introduction to the issue itself, and why you consider it to be a bug --> <!--- Ensure that all code ``` is surrounded ``` by triple back quotes. This can also be done over multiple lines --> #### Expected Behavior <!--- Tell us what should happen --> date_end should depend on duration #### Actual Behavior date_end = date_start in the database <!--- Tell us what happens instead --> <!--- Also please check relevant logs (suitecrm.log, php error.log etc.) --> #### Possible Fix <!--- Not obligatory, but suggest a fix or reason for the bug --> in Calls save function, replace if (!empty($this->duration_hours) && !empty($this->duration_minutes)) { by if (!empty($this->duration_hours) || !empty($this->duration_minutes)) { #### Steps to Reproduce <!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- reproduce this bug include code to reproduce, if relevant --> 1. Create a call with duration = 15mn 2. Look at that call in the database 3. date_end is equal to date_start #### Context <!--- How has this bug affected you? What were you trying to accomplish? --> <!--- If you feel this should be a low/medium/high priority then please state so --> #### Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * SuiteCRM Version used: 7.12.10 * Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): any * Environment name and version (e.g. MySQL, PHP 7): PHP 7.4 * Operating System and version (e.g Ubuntu 16.04):
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#4979
No description provided.