Problems with Custom Skeleton Module

I’ve been playing around with the Custom Skeleton Module with an eye toward eventually converting some of my customizations into modules in the hope that they will be easier to maintain through various OpenEMR updates and upgrades. Unfortunately, after negotiating my way through the cloning of the module to the interface/modules/custom_modules folder and then registering, installing and enabling the module I’m left with a system that won’t work. After doing so every menu item that I click on ends up displaying a blank page entitled “Unknown” on the tab. Upon exiting I can’t even log back in again as the login screen is blank as well. Any ideas?

For the record, I’m running Ubuntu 20.4 LTS Server on a virtual machine. It’s a new install running PHP 8.1.2. Could the PHP version be the problem?

What does your PHP error logs show? I haven’t tested the module on 8.1.2 but I would assume it works. Most likely you need to dump your composer auto-load as you are getting a class not found exception. Your PHP error logs should give you more details on what is going on.

Thank you. I’ll look into that and report back if/when I find anything. In the meantime, on my base machine (M1 Mac with PHP version 7.4.23) I was able to get things running properly after running the “composer require adunsulag/oe-module-custom-skeleton” command.

Edit: here are the contents added to /var/log/apache2/error.log when I attempt to start OpenEMR -
[Mon Apr 25 07:34:49.286192 2022] [php:error] [pid 32787] [client 10.211.55.2:51483] PHP Fatal error: Uncaught Error: OpenEMR\Modules\CustomModuleSkeleton\GlobalConfig::__construct(): Argument #1 ($globalsArray) cannot be passed by reference in /var/www/html/openemr/interface/modules/custom_modules/oe-module-custom-skeleton/src/Bootstrap.php:89\nStack trace:\n#0 /var/www/html/openemr/interface/modules/custom_modules/oe-module-custom-skeleton/openemr.bootstrap.php(23): OpenEMR\Modules\CustomModuleSkeleton\Bootstrap->__construct()\n#1 /var/www/html/openemr/src/Core/ModulesApplication.php(108): include(’…’)\n#2 /var/www/html/openemr/src/Core/ModulesApplication.php(96): OpenEMR\Core\ModulesApplication->loadCustomModule()\n#3 /var/www/html/openemr/src/Core/ModulesApplication.php(70): OpenEMR\Core\ModulesApplication->bootstrapCustomModules()\n#4 /var/www/html/openemr/interface/globals.php(620): OpenEMR\Core\ModulesApplication->__construct()\n#5 /var/www/html/openemr/interface/login/login.php(34): require_once(’…’)\n#6 {main}\n thrown in /var/www/html/openemr/interface/modules/custom_modules/oe-module-custom-skeleton/src/Bootstrap.php on line 89
[Mon Apr 25 07:34:50.530159 2022] [php:error] [pid 32785] [client 10.211.55.2:51484] PHP Fatal error: Uncaught Error: OpenEMR\Modules\CustomModuleSkeleton\GlobalConfig::__construct(): Argument #1 ($globalsArray) cannot be passed by reference in /var/www/html/openemr/interface/modules/custom_modules/oe-module-custom-skeleton/src/Bootstrap.php:89\nStack trace:\n#0 /var/www/html/openemr/interface/modules/custom_modules/oe-module-custom-skeleton/openemr.bootstrap.php(23): OpenEMR\Modules\CustomModuleSkeleton\Bootstrap->__construct()\n#1 /var/www/html/openemr/src/Core/ModulesApplication.php(108): include(’…’)\n#2 /var/www/html/openemr/src/Core/ModulesApplication.php(96): OpenEMR\Core\ModulesApplication->loadCustomModule()\n#3 /var/www/html/openemr/src/Core/ModulesApplication.php(70): OpenEMR\Core\ModulesApplication->bootstrapCustomModules()\n#4 /var/www/html/openemr/interface/globals.php(620): OpenEMR\Core\ModulesApplication->__construct()\n#5 /var/www/html/openemr/interface/login/login.php(34): require_once(’…’)\n#6 {main}\n thrown in /var/www/html/openemr/interface/modules/custom_modules/oe-module-custom-skeleton/src/Bootstrap.php on line 89