Prescription Zend Module Unable to Construct Container for HTML and PDF

Situation
I get the following error when attempting to view a prescription from the zend module for PDF and HTML view.

OpenEMR Version
I’m using OpenEMR version 5.0.2(1)

Browser:
I’m using: Chrome and or Firefox

Operating System
I’m using: MacOS (laptop) accessing via AWS build

Logs
Did you check the logs? Was there anything pertinent in them? Paste them here (surround with three backticks (```) for readability.

Not yet… specific details for PDF rendering

# An error occurred

## An error occurred during execution; please try again later.

## Additional information:

### Error

File:

/var/www/openemr/interface/modules/zend_modules/module/PrescriptionTemplates/src/PrescriptionTemplates/Controller/PdfTemplatesController.php:43

Message:

Cannot call constructor

Stack trace:

#0 /var/www/openemr/interface/modules/zend_modules/module/PrescriptionTemplates/config/module.config.php(36): PrescriptionTemplates\Controller\PdfTemplatesController->__construct(Object(Zend\ServiceManager\ServiceManager)) #1 /var/www/openemr/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(764): PrescriptionTemplates\Module->PrescriptionTemplates\{closure}(Object(Zend\ServiceManager\ServiceManager), 'PrescriptionTem...', NULL) #2 /var/www/openemr/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(200): Zend\ServiceManager\ServiceManager->doCreate('PrescriptionTem...') #3 /var/www/openemr/vendor/zendframework/zend-servicemanager/src/AbstractPluginManager.php(152): Zend\ServiceManager\ServiceManager->get('PrescriptionTem...') #4 /var/www/openemr/vendor/zendframework/zend-mvc/src/DispatchListener.php(102): Zend\ServiceManager\AbstractPluginManager->get('PrescriptionTem...') #5 /var/www/openemr/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent)) #6 /var/www/openemr/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure)) #7 /var/www/openemr/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent)) #8 /var/www/openemr/src/Core/ModulesApplication.php(105): Zend\Mvc\Application->run() #9 /var/www/openemr/interface/modules/zend_modules/public/index.php(52): OpenEMR\Core\ModulesApplication->run() #10 {main}

For HTML renders it is the same error, just line 40 on the Htmlconstructor code

# An error occurred

## An error occurred during execution; please try again later.

## Additional information:

### Error

File:

/var/www/openemr/interface/modules/zend_modules/module/PrescriptionTemplates/src/PrescriptionTemplates/Controller/HtmlTemplatesController.php:40

Message:

Cannot call constructor

Stack trace:

#0 /var/www/openemr/interface/modules/zend_modules/module/PrescriptionTemplates/config/module.config.php(33): PrescriptionTemplates\Controller\HtmlTemplatesController->__construct(Object(Zend\ServiceManager\ServiceManager)) #1 /var/www/openemr/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(764): PrescriptionTemplates\Module->PrescriptionTemplates\{closure}(Object(Zend\ServiceManager\ServiceManager), 'PrescriptionTem...', NULL) #2 /var/www/openemr/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(200): Zend\ServiceManager\ServiceManager->doCreate('PrescriptionTem...') #3 /var/www/openemr/vendor/zendframework/zend-servicemanager/src/AbstractPluginManager.php(152): Zend\ServiceManager\ServiceManager->get('PrescriptionTem...') #4 /var/www/openemr/vendor/zendframework/zend-mvc/src/DispatchListener.php(102): Zend\ServiceManager\AbstractPluginManager->get('PrescriptionTem...') #5 /var/www/openemr/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent)) #6 /var/www/openemr/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure)) #7 /var/www/openemr/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent)) #8 /var/www/openemr/src/Core/ModulesApplication.php(105): Zend\Mvc\Application->run() #9 /var/www/openemr/interface/modules/zend_modules/public/index.php(52): OpenEMR\Core\ModulesApplication->run() #10 {main}

hi @kevin_ytc could you share a screenshot? You loaded the prescription module via Modules->Manage modules?

So, I might have fixed this. In the settings, I unchecked “Enable zend module for HTML” and “Print” and now both buttons on the prescription module work fine. HTML generates and then opens in print dialog and print opens in print dialogue.

hi @kevin_ytc, nice fix but it is a bug since you’ve reverted back to the non-zend view of the Rx.