7.0.1 (1) Error log, CAMOS and Appt finder issues

Situation
We are almost two weeks into our new upgrade to 7.0.1 (1) and we’re pleased with the speedy performance of the new version but we’re still unable to fix some issues.
Apache2 error log has recorded periods of upwards of 13,000 warning entries per hour.

OpenEMR Version
I’m using OpenEMR version 7.0.1 (1) with Maria Db

Browser:
I’m using: FF 118.0.1 (64-bit)

Operating System
I’m using: Ubuntu 22.04 Php 8.1

Search
Did you search the forum for similar questions? yes and I found this “fix” but it generated Fatal php errors.

The file in question is; openemr/library/forms.inc.php
This is the code modification suggested and it goes at the end of the file.

{
// get the aco spec from registry table
$formRow = sqlQuery(“SELECT aco_spec FROM registry WHERE directory = ?”, array($formDir));
$permission = explode(’|’, $formRow[‘aco_spec’]);
//    return AclMain::aclCheckCore($permission[0], $permission[1]);
return AclMain::aclCheckCore(isset($permission[0])?$permission[0]:’’, isset($permission[1])?$permission[1]:’’);

} 

Logs
Did you check the logs? yes
Was there anything pertinent in them? yes

Please paste them here (surround with three backticks (```) for readability.
You can also turn on User Debugging under Administration->Globals->Logging User Debugging Options=>All

[Thu Oct 05 12:53:17.776366 2023] [php:error] [pid 616650] [client 192.168.1.124:38118] PHP Fatal error:  Uncaught Error: Undefined constant "\xe2\x80\x99\xe2\x80\x99" in /var/www/html/openemr/library/forms.inc.php:164\nStack trace:\n#0 /var/www/html/openemr/interface/patient_file/history/encounters.php(583): hasFormPermission()\n#1 {main}\n  thrown in /var/www/html/openemr/library/forms.inc.php on line 164, referer: https://192.168.1.131/openemr/interface/main/tabs/main.php?token_main=0LU1AsJmH2yjSTF9STrZIIyDBiMB6SJkPxhR3FK4

The fatal errors stop when the code is reverted back but there are many other php errors being reported and some point to issues providers are complaining about including not being able to save patient notes due to CAMOS authentication errors and the calendar appointment finder not working.

[Thu Oct 05 12:59:06.662823 2023] [php:notice] [pid 617774] [client 192.168.1.110:34526] OpenEMR CSRF token authentication error, referer: https://192.168.1.131/openemr/interface/patient_file/encounter/load_form.php?formname=CAMOS

and

[Thu Oct 05 13:00:28.383546 2023] [php:error] [pid 617758] [client 192.168.1.110:60570] PHP Fatal error:  Uncaught Error: Undefined constant "\xe2\x80\x99\xe2\x80\x99" in /var/www/html/openemr/library/forms.inc.php:164\nStack trace:\n#0 /var/www/html/openemr/interface/patient_file/history/encounters.php(583): hasFormPermission()\n#1 {main}\n  thrown in /var/www/html/openemr/library/forms.inc.php on line 164, referer: https://192.168.1.131/openemr/interface/main/tabs/main.php?token_main=yC94CqCgCewkByCirsecvJ1VBpkKLafZyKxIR7Ai
[Thu Oct 05 13:00:35.074404 2023] [php:warn] [pid 617904] [client 192.168.1.110:36068] PHP Warning:  Undefined array key "mode" in /var/www/html/openemr/interface/forms/CAMOS/new.php on line 22, referer: https://192.168.1.131/openemr/interface/patient_file/encounter/encounter_top.php?set_encounter=155571
[Thu Oct 05 13:00:35.074429 2023] [php:warn] [pid 617904] [client 192.168.1.110:36068] PHP Warning:  Undefined array key "hidden_category" in /var/www/html/openemr/interface/forms/CAMOS/new.php on line 60, referer: https://192.168.1.131/openemr/interface/patient_file/encounter/encounter_top.php?set_encounter=155571
[Thu Oct 05 13:00:35.074434 2023] [php:warn] [pid 617904] [client 192.168.1.110:36068] PHP Warning:  Undefined array key "hidden_subcategory" in /var/www/html/openemr/interface/forms/CAMOS/new.php on line 64, referer: https://192.168.1.131/openemr/interface/patient_file/encounter/encounter_top.php?set_encounter=155571
[Thu Oct 05 13:00:35.074439 2023] [php:warn] [pid 617904] [client 192.168.1.110:36068] PHP Warning:  Undefined array key "hidden_item" in /var/www/html/openemr/interface/forms/CAMOS/new.php on line 68, referer: https://192.168.1.131/openemr/interface/patient_file/encounter/encounter_top.php?set_encounter=155571
[Thu Oct 05 13:00:35.074443 2023] [php:warn] [pid 617904] [client 192.168.1.110:36068] PHP Warning:  Undefined array key "hidden_mode" in /var/www/html/openemr/interface/forms/CAMOS/new.php on line 107, referer: https://192.168.1.131/openemr/interface/patient_file/encounter/encounter_top.php?set_encounter=155571
[Thu Oct 05 13:00:35.074448 2023] [php:warn] [pid 617904] [client 192.168.1.110:36068] PHP Warning:  Undefined array key "hidden_mode" in /var/www/html/openemr/interface/forms/CAMOS/new.php on line 179, referer: https://192.168.1.131/openemr/interface/patient_file/encounter/encounter_top.php?set_encounter=155571
[Thu Oct 05 13:00:36.369233 2023] [php:warn] [pid 617904] [client 192.168.1.110:36068] PHP Warning:  Undefined array key "clone_others_search" in /var/www/html/openemr/interface/forms/CAMOS/new.php on line 1219, referer: https://192.168.1.131/openemr/interface/patient_file/encounter/encounter_top.php?set_encounter=155571

The following two lines from the error log are the first and last of 3,026 entries.

[Thu Oct 05 13:52:44.174491 2023] [php:warn] [pid 622357] [client 192.168.1.128:44718] PHP Warning:  Undefined array key 1068 in /var/www/html/openemr/interface/main/calendar/find_appt_popup.php on line 87, referer: https://192.168.1.131/openemr/interface/main/tabs/main.php?token_main=qSmaZM6SehAcWmFZMBC1veQCYqAnJpheDZ1D7M8D
[Thu Oct 05 13:52:44.186662 2023] [php:warn] [pid 622357] [client 192.168.1.128:44718] PHP Warning:  Undefined array key 1092 in /var/www/html/openemr/interface/main/calendar/find_appt_popup.php on line 376, referer: https://192.168.1.131/openemr/interface/main/tabs/main.php?token_main=qSmaZM6SehAcWmFZMBC1veQCYqAnJpheDZ1D7M8D