Exception displaying Module Information (Module Menu)
-
Version: 1.5.2
PHP Version: 8.0An exception is thrown when trying to display the modules (selection of the Modules Menu).
This MAY be because our server is using PHP 8.0 and some warnings are escalated to ERRORS.
Here are the details of the exception:[PrestaShop] Fatal error in module file :/usr/share/hotelcommerce-1.5.2/classes/controller/AdminController.php:
Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given in /usr/share/hotelcommerce-1.5.2/classes/controller/AdminController.php:4171Stack trace:
#0 /usr/share/hotelcommerce-1.5.2/classes/controller/AdminController.php(4171): method_exists()
#1 /usr/share/hotelcommerce-1.5.2/classes/controller/AdminController.php(4092): AdminControllerCore->displayModuleOptions()
#2 /usr/share/hotelcommerce-1.5.2/controllers/admin/AdminModulesController.php(1553): AdminControllerCore->fillModuleData()
#3 /usr/share/hotelcommerce-1.5.2/classes/controller/Controller.php(189): AdminModulesControllerCore->initContent()
#4 /usr/share/hotelcommerce-1.5.2/classes/Dispatcher.php(367): ControllerCore->run()
#5 /usr/share/hotelcommerce-1.5.2/admin375hurphk/index.php(58): DispatcherCore->dispatch() #6 {main} thrown... and the offending code:
if (Validate::isModuleName($module->name)) {
if (method_exists(Module::getInstanceByName($module->name), 'reset')) {
$is_reset_ready = true;
}
} -
Hi @jloper,
QloApps is compatible with PHP 5.6 to 7.4. Currently, it does not support PHP 8.
We recommend you please downgrade your PHP version to a compatible version of PHP.
You can check the complete recommended configuration here (https://qloapps.com/install-qloapps/#section-8). -
I understand and expected that to be the answer. That is why I suggested that was the case in the original post.
I am committed to (/stuck with) PHP 8.0. I am a developer. What is the process to help validate the code on PHP 8.0?
I can certainly make the changes as I find the need.jloper
-
To make QloApps compatible with PHP 8, you can use a PHP compatibility check tool to update the deprecated and removed functions or you can cross-check PHP 8 changelog and update functions as required.
We suggest you use a compatibility tool for easier migration to PHP 8.