Skip to content

[YF 7.0.4] Error when changing ticket status #127

Open
@diderich

Description

@diderich

When I try to save the ticket status, I get the following error:

E_WARNING: Trying to access array offset on int in /opt/crm7/app/Utils/ServiceContracts.php, line 399
#0 app/Utils/ServiceContracts.php:356  >>  App\Utils\ServiceContracts->getDiffFromDefaultBusinessHours('2025-03-25 11:08:18','2025-03-27 15:19:36')
#1 app/Utils/ServiceContracts.php:323  >>  App\Utils\ServiceContracts->getDiffFromServiceContracts('2025-03-25 11:08:18','2025-03-27 15:19:36',1722)
#2 app/RecordStatus.php:302  >>  App\Utils\ServiceContracts->getDiff('2025-03-25 11:08:18')
#3 modules/Vtiger/handlers/RecordStatusHistory.php:27  >>  App\RecordStatus->update(,'ticketstatus')
#4 app/EventHandler.php:544  >>  Vtiger_RecordStatusHistory_Handler->entityBeforeSave(,[73,EntityBeforeSave,Vtiger_RecordStatusHistory_Handler,1,HelpDesk,,5,0,0])
#5 app/EventHandler.php:520  >>  App\EventHandler->triggerHandler([73,EntityBeforeSave,Vtiger_RecordStatusHistory_Handler,1,HelpDesk,,5,0,0])
#6 modules/Vtiger/models/Record.php:550  >>  App\EventHandler->trigger('EntityBeforeSave')
#7 modules/Vtiger/actions/Save.php:112  >>  Vtiger_Record_Model->save()
#8 modules/Vtiger/actions/SaveAjax.php:25  >>  Vtiger_Save_Action->saveRecord()
#9 include/main/WebUI.php:161  >>  Vtiger_SaveAjax_Action->process()
#10 index.php:26  >>  Vtiger_WebUI->process()
#11 public_html/index.php:13  >>  require('index.php')

Changing line 399 from
if ($row['working_days']) {
to
if (isset($row['working_days']) && $row['working_days']) {
addresses the issue. But that is probably not the root cause of the problem.

On the demo system, the error does not occur. So I assume I have an issue with the working days configuration, but have not been able to figure it out.

My business hours table looks like this:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions