Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YF 7.0.4] Error when changing ticket status #127

Open
diderich opened this issue Mar 27, 2025 · 1 comment
Open

[YF 7.0.4] Error when changing ticket status #127

diderich opened this issue Mar 27, 2025 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@diderich
Copy link

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

@rskrzypczak
Copy link
Contributor

Thanks for issue @diderich
FYI: $businessHours shouldn't be a multidimensional array here, so remove the foreach loop and replace $row with $businessHours and it should be OK ;)

@rskrzypczak rskrzypczak added the bug Something isn't working label Mar 27, 2025
@rskrzypczak rskrzypczak added this to the 7.0.5 milestone Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants