# Fatal Php error

**URL:** <https://community.open-emr.org/t/fatal-php-error/23903>\
**Category:** Support\
**Created:** [November 26, 2024, 6:22pm UTC](https://community.open-emr.org/t/fatal-php-error/23903 "2024-11-26T18:22:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hitechelp](https://community.open-emr.org/user_avatar/community.open-emr.org/hitechelp/32/11911_2.png) [@hitechelp](https://community.open-emr.org/u/hitechelp)\
**Post date:** [November 26, 2024, 6:22pm UTC](https://community.open-emr.org/t/fatal-php-error/23903/1 "2024-11-26T18:22:28Z")

</div>

**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

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [November 26, 2024, 6:33pm UTC](https://community.open-emr.org/t/fatal-php-error/23903/2 "2024-11-26T18:33:51Z")

</div>

> <https://github.com/openemr/openemr/blob/rel-702/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/ajax_template.html#L629>

try

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

---

<div class="post-metadata">

**Author:** ![hitechelp](https://community.open-emr.org/user_avatar/community.open-emr.org/hitechelp/32/11911_2.png) [@hitechelp](https://community.open-emr.org/u/hitechelp)\
**Post date:** [November 26, 2024, 10:25pm UTC](https://community.open-emr.org/t/fatal-php-error/23903/3 "2024-11-26T22:25:18Z")

</div>

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

![Smarty PHP Error FIX](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/f/1/f16b406c7580a9f6a60e95ed689b81e994ec8065.png)

`[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`

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [November 26, 2024, 10:38pm UTC](https://community.open-emr.org/t/fatal-php-error/23903/4 "2024-11-26T22:38:44Z")

</div>

oops, try this instead

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

---

<div class="post-metadata">

**Author:** ![hitechelp](https://community.open-emr.org/user_avatar/community.open-emr.org/hitechelp/32/11911_2.png) [@hitechelp](https://community.open-emr.org/u/hitechelp)\
**Post date:** [November 26, 2024, 11:04pm UTC](https://community.open-emr.org/t/fatal-php-error/23903/5 "2024-11-26T23:04:52Z")

</div>

> [@stephenwaite](#):
>
> `$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`

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [November 26, 2024, 11:30pm UTC](https://community.open-emr.org/t/fatal-php-error/23903/6 "2024-11-26T23:30:52Z")

</div>

let’s fix both lines while we’re in here 🙂

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

---

<div class="post-metadata">

**Author:** ![hitechelp](https://community.open-emr.org/user_avatar/community.open-emr.org/hitechelp/32/11911_2.png) [@hitechelp](https://community.open-emr.org/u/hitechelp)\
**Post date:** [November 26, 2024, 11:46pm UTC](https://community.open-emr.org/t/fatal-php-error/23903/7 "2024-11-26T23:46:57Z")

</div>

> [@stephenwaite](#):
>
> ```auto
> $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
