Error when pulling up docs in Visit History tab

Situation
When viewing documents on the Visit History tab, we get the following error: Unable to load controller DocId , please check the first argument supplied in the URL and try again

OpenEMR Version
Latest. V8, patch 3.

Browser:
I’m using: Chrome

Operating System
I’m using: MacOS Tahoe 26.3.1. Staff has repro’d in Windows 11.

Search
Yes

Logs
```[07-Apr-2026 09:13:47 America/Denver] PHP Warning: include_once(/home/zzz/public_html/emr/controllers/C_DocId.class.php): Failed to open stream: No such file or directory in /home/zzz/public_html/emr/library/classes/Controller.class.php on line 74
[07-Apr-2026 09:13:47 America/Denver] PHP Warning: include_once(): Failed opening ‘/home/zzz/public_html/emr/controllers/C_DocId.class.php’ for inclusion (include_path=‘/home/zzz/public_html/emr/vendor/pear/archive_tar:/home/zzz/public_html/emr/vendor/pear/console_getopt:/home/zzz/public_html/emr/vendor/pear/pear-core-minimal/src:/home/zzz/public_html/emr/vendor/pear/pear_exception:.:/opt/cpanel/ea-php82/root/usr/share/pear’) in /home/zzz/public_html/emr/library/classes/Controller.class.php on line 74```

hi @midder, working on a fix here.

Thanks @stephenwaite

hi @midder, try replacing your interface/patient_file/history/encounters.php with this patched version. It’s going to be fixed more properly in the next release but this should tide you over until then.

2 Likes

Looks like that works. Thanks again @stephenwaite !

This patch also worked for us, thank you.

After replacing encounters.php with this version we experienced a 500 Internal Server Error - the relevant log entry is reproduced below. The solution was to correct the permissions in the documents directory, as described in issue 26598:

Apache error for Google-ability:

[php:error] [pid 3565:tid 3565] [client 10.6.0.2:33782] PHP Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/data/www/html/openemr/sites/default/documents/smarty/main/%%1E): Failed to open directory: Permission denied in /data/www/html/openemr/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php:76\nStack trace:\n#0 [internal function]: RecursiveDirectoryIterator->__construct()\n#1 /data/www/html/openemr/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php(76): RecursiveDirectoryIterator->getChildren()\n#2 /data/www/html/openemr/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php(133): Smarty_Internal_Method_ClearCompiledTemplate->clearCompiledTemplate()\n#3 /data/www/html/openemr/vendor/smarty/smarty/libs/sysplugins/smarty_internal_data.php(270): Smarty_Internal_Extension_Handler->_callExternalMethod()\n#4 /data/www/html/openemr/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(494): Smarty_Internal_Data->__call()\n#5 /data/www/html/openemr/sites/default/documents/smarty/main/a6ecfa90bb83cc9a6bdd321dfcc14d47b6e46513_0.file.general_view.html.php(6): Smarty_Internal_Template->_decodeProperties()\n#6 /data/www/html/openemr/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(148): include(‘…’)\n#7 /data/www/html/openemr/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(105): Smarty_Template_Compiled->process()\n#8 /data/www/html/openemr/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render()\n#9 /data/www/html/openemr/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render()\n#10 /data/www/html/openemr/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute()\n#11 /data/www/html/openemr/controllers/C_Document.class.php(586): Smarty_Internal_TemplateBase->fetch()\n#12 /data/www/html/openemr/library/classes/Controller.class.php(157): C_Document->view_action()\n#13 /data/www/html/openemr/controller.php(6): Controller->act()\n#14 {main}\n thrown in /data/www/html/openemr/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php on line 76, referer: https://[siteURL]/openemr/interface/patient_file/history/encounters.php