Fatal Php error

Situation
User reported a “glitch” when editing and saving a calendar entry for a Provider’s “Out of Office” entry - stated screen went White and all the providers appointments “disappeared from the calendar”. We are no longer able to edit that day’s Calendar by double clicking time entries because the pop-up edit window no longer appears. No other day(s) seem to be affected.

OpenEMR Version
I’m using OpenEMR version (7.0.2.2)

Browser:
FF 132 (64bit)

Operating System
I’m using: Ubuntu 22.04.5 LTS (GNU/Linux 5.15.0-126-generic x86_64)

Search
Yes, Nothing relevant found.

Logs
Did you check the logs? YES
Was there anything pertinent in them? YES
Tue Nov 26 12:45:08.628516 2024] [php:error] [pid 1395] [client 192.168.1.242:54268] PHP Fatal error: Uncaught TypeError: Unsupported operand types: int + string in /var/www/html/openemr/sites/default/documents/smarty/main/%%1E/1EA/1EA5C8E9%%ajax_template.html.php:630\nStack trace:\n#0 /var/www/html/openemr/library/smarty_legacy/smarty/Smarty_Legacy.class.php(1881): include()\n#1 /var/www/html/openemr/sites/default/documents/smarty/main/%%61/61F/61F56BD5%%default.html.php(11): Smarty_Legacy->_smarty_include()\n#2 /var/www/html/openemr/library/smarty_legacy/smarty/Smarty_Legacy.class.php(1275): include('...')\n#3 /var/www/html/openemr/interface/main/calendar/modules/PostCalendar/pnuserapi.php(589): Smarty_Legacy->fetch()\n#4 /var/www/html/openemr/interface/main/calendar/includes/pnMod.php(433): postcalendar_userapi_buildView()\n#5 /var/www/html/openemr/interface/main/calendar/modules/PostCalendar/pnuser.php(112): pnModAPIFunc()\n#6 /var/www/html/openemr/interface/main/calendar/modules/PostCalendar/pnuser.php(75): postcalendar_user_display()\n#7 /var/www/html/openemr/interface/main/calendar/includes/pnMod.php(465): postcalendar_user_view()\n#8 /var/www/html/openemr/interface/main/calendar/index.php(155): pnModFunc()\n#9 {main}\n thrown in /var/www/html/openemr/sites/default/documents/smarty/main/%%1E/1EA/1EA5C8E9%%ajax_template.html.php on line 630, referer: https://192.168.1.131/openemr/interface/main/calendar/index.php?module=PostCalendar&func=view&viewtype=day

You can also turn on User Debugging under Administration->Globals->Logging User Debugging Options=>All

try

$event['duration'] = intval($calEndMin - $eStartMin) * 60; // duration is in seconds

Remarked out 629 tried your code but still no edit pop-up.

Smarty PHP Error FIX

[Tue Nov 26 17:07:04.516057 2024] [php:error] [pid 7845] [client ip_address:port] PHP Fatal error: Uncaught TypeError: Unsupported operand types: int + string in /var/www/html/openemr/sites/default/documents/smarty/main/%%1E/1EA/1EA5C8E9%%ajax_template.html.php:630\nStack trace:\n#0 /var/www/html/openemr/library/smarty_legacy/smarty/Smarty_Legacy.class.php(1881): include()\n#1 /var/www/html/openemr/sites/default/documents/smarty/main/%%61/61F/61F56BD5%%default.html.php(11): Smarty_Legacy->_smarty_include()\n#2 /var/www/html/openemr/library/smarty_legacy/smarty/Smarty_Legacy.class.php(1275): include('...')\n#3 /var/www/html/openemr/interface/main/calendar/modules/PostCalendar/pnuserapi.php(589): Smarty_Legacy->fetch()\n#4 /var/www/html/openemr/interface/main/calendar/includes/pnMod.php(433): postcalendar_userapi_buildView()\n#5 /var/www/html/openemr/interface/main/calendar/modules/PostCalendar/pnuser.php(112): pnModAPIFunc()\n#6 /var/www/html/openemr/interface/main/calendar/modules/PostCalendar/pnuser.php(75): postcalendar_user_display()\n#7 /var/www/html/openemr/interface/main/calendar/includes/pnMod.php(465): postcalendar_user_view()\n#8 /var/www/html/openemr/interface/main/calendar/index.php(155): pnModFunc()\n#9 {main}\n thrown in /var/www/html/openemr/sites/default/documents/smarty/main/%%1E/1EA/1EA5C8E9%%ajax_template.html.php on line 630, referer: https://ip_address/openemr/interface/main/calendar/index.php?module=PostCalendar&func=view&viewtype=day

oops, try this instead

$event['duration'] = (intval($calEndMin) - intval($eStartMin)) * 60; // duration is in seconds

No joy.
[Tue Nov 26 18:02:00.616402 2024] [php:error] [pid 17797] [client IP:Port] PHP Fatal error: Uncaught TypeError: Unsupported operand types: int + string in /var/www/html/openemr/sites/default/documents/smarty/main/%%1E/1EA/1EA5C8E9%%ajax_template.html.php:630\nStack trace:\n#0 /var/www/html/openemr/library/smarty_legacy/smarty/Smarty_Legacy.class.php(1881): include()\n#1 /var/www/html/openemr/sites/default/documents/smarty/main/%%61/61F/61F56BD5%%default.html.php(11): Smarty_Legacy->_smarty_include()\n#2 /var/www/html/openemr/library/smarty_legacy/smarty/Smarty_Legacy.class.php(1275): include('...')\n#3 /var/www/html/openemr/interface/main/calendar/modules/PostCalendar/pnuserapi.php(589): Smarty_Legacy->fetch()\n#4 /var/www/html/openemr/interface/main/calendar/includes/pnMod.php(433): postcalendar_userapi_buildView()\n#5 /var/www/html/openemr/interface/main/calendar/modules/PostCalendar/pnuser.php(112): pnModAPIFunc()\n#6 /var/www/html/openemr/interface/main/calendar/modules/PostCalendar/pnuser.php(75): postcalendar_user_display()\n#7 /var/www/html/openemr/interface/main/calendar/includes/pnMod.php(465): postcalendar_user_view()\n#8 /var/www/html/openemr/interface/main/calendar/index.php(155): pnModFunc()\n#9 {main}\n thrown in /var/www/html/openemr/sites/default/documents/smarty/main/%%1E/1EA/1EA5C8E9%%ajax_template.html.php on line 630, referer: https://IP/openemr/interface/main/calendar/index.php?module=PostCalendar&func=view&viewtype=day

let’s fix both lines while we’re in here :slight_smile:

$outMins = ($outH * 60) + intval($outM);
$event['duration'] = (intval($outMins) - intval($eStartMin)) * 60; // duration is in seconds

Well done indeed, the third time is the charm!

Many thanks to you Stephen