Some of the functions of the calendar stopped working

Yesterday afternoon an issue developed where if your calendar view is set to day, it works fine. If you click the week button, the calendar switches to the week view, but no appointments show up. If you’ve selected the week button then you try to go back to day. The calendar never goes back to day. It stays stuck at the week view.

I’ve posted some info from the error logs below.

As maybe a coincidence (or maybe not). Shortly before this happened, i had open the Admin->Acl then the main Gacl screen. I looked around through there but i never clicked the submit button on anything. The timing seems like more than just a coincedence. But I don’t know what would have changed or how to change it back.

The problem affects all users no matter which groups they are in.

OpenEMR Version
I’m using OpenEMR version 7.0.0(2)

Browser:
I’m using: Chromium

Operating System
I’m using: Ubuntu 22.04

Search
Did you search the forum for similar questions? Yes

Logs
Did you check the logs?

[Tue Jan 28 07:47:56.357810 2025] [php:error] [pid 18846] [client 10.0.1.226:60176] PHP Fatal error:  Uncaught TypeError: Unsupported operand types: int + string in /var/www/html/openemr/sites/default/documents/smarty/main/%%C9/C93/C9312278%%ajax_template.html.php:532\nStack trace:\n#0 /var/www/html/openemr/vendor/smarty/smarty/libs/Smarty.class.php(1875): include()\n#1 /var/www/html/openemr/sites/default/documents/smarty/main/%%BF/BF1/BF15E2DB%%default.html.php(12): Smarty->_smarty_include()\n#2 /var/www/html/openemr/vendor/smarty/smarty/libs/Smarty.class.php(1269): include('...')\n#3 /var/www/html/openemr/interface/main/calendar/modules/PostCalendar/pnuserapi.php(589): Smarty->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/%%C9/C93/C9312278%%ajax_template.html.php on line 532, referer: http://10.0.1.84/openemr/interface/main/calendar/index.php?module=PostCalendar&func=view&tplview=default&pc_category=&pc_topic=
[Tue Jan 28 07:47:58.433897 2025] [php:warn] [pid 18859] [client 10.0.1.226:60191] PHP Warning:  Undefined array key "catid" in /var/www/html/openemr/sites/default/documents/smarty/main/%%C9/C93/C9312278%%ajax_template.html.php on line 510, referer: http://10.0.1.84/openemr/interface/main/calendar/index.php?module=PostCalendar&func=view&tplview=default&pc_category=&pc_topic=
[Tue Jan 28 07:47:58.433945 2025] [php:warn] [pid 18859] [client 10.0.1.226:60191] PHP Warning:  Undefined array key "eid" in /var/www/html/openemr/sites/default/documents/smarty/main/%%C9/C93/C9312278%%ajax_template.html.php on line 513, referer: http://10.0.1.84/openemr/interface/main/calendar/index.php?module=PostCalendar&func=view&tplview=default&pc_category=&pc_topic=

EDIT
I checked my sandbox server that isn’t having this issue. I noticed in it’s log file the two warning messages are present on that system. But the fatal error isn’t. So maybe the warnings aren’t really important to this problem.

hi @bearzillasquatch , think this was fixed in this commit.

1 Like

I’ll check into that.

It’s just odd that we’ve been running this version for 2 years and this issue just showed up. (the error part just showed up).

Thanks

sometimes php updates as part of ubuntu system updates, likely you moved to php8.3

1 Like

So i made the changes in the day, week, month ajax template files and it seems to be working correctly now.

As a side note:
I check the php versions on both the production server and the sandbox server. Both are running php 8.1.2. The sandbox server works fine without the changes. The production server required the changes to start working again. The production server had been working for 2 years without these changes.

We may never know.

But thanks @stephenwaite for getting me the info to get back working.

1 Like

I vaguely recall that the PHP GACL library which we use to handle our ACL management will also trigger a smarty cache clear for some functionality. If your smarty cache hadn’t been cleared for certain files in over 2 years I could see this problem happening.

I’ve used the “clear smarty cache” button in the Admin->Clinic->Calendar screen. I’m not sure if that clears everything or just part.

Maybe that scenario is what happened. Either way it’s working now. There is one odd side effect from casting the variable to INT. Now on the calendar if the time slot is an even hour. In stead of showing something like 10:00. It shows 10:0. Is that the behavior that is happening to everyone?

I think I can just use string padding to add a zero if the number is only one digit. I noticed in other parts of the same file, there are if statements that check the string length and if less than 2 it concatenates a 0 to the front of the string (for the minutes). For some reason that isn’t done everywhere the minutes are used.

1 Like