Jump to content

Weird error PS 1.7.2.2 Call to undefined method Module::isEnabled()


Vlad Popoiu

Recommended Posts

Hello,

I encountered a weird error with my prestashop website. The website was running smoothly until the hosting provider decided they need to upgrade the server. They did it without any notice, and then the hell unleashed.

Website details:

Quote

 

PS Version: 1.7.7.2

Server software version: LiteSpeed

PHP Version: 7.3.33

Memory limit: 2048M

Max execution time: 300

Max upload size: 512M

MySQL version: 10.3.35-MariaDB

MySQL Engine: InnoDB

Driver MySQL: DbPDO

 

The problem:

The problem appears when trying to clear the cache, uninstall modules, or reset them.

After trying to do any of the tasks above, I get this error:

Attempted to call an undefined method named "isEnabled" of class "Module". [Symfony\Component\Debug\Exception\UndefinedMethodException 0]

As seen in the screenshots below, when trying to activate debug mode I get HTTP ERROR 500. This is when the website becomes unreachable by any means, front office and back office.

I tried activating debug mode before trying to uninstall any module, also, deactivated cache, overrides and forced compiling and I get this error:

Quote

Fatal error: Uncaught Error: Class 'AddressFormat' not found in /home/rmagaz72/public_html/classes/Tools.php:3386 Stack trace: #0 /home/rmagaz72/public_html/classes/db/Db.php(794): ToolsCore::nl2br('configuration') #1 /home/rmagaz72/public_html/config/alias.php(47): DbCore->escape('configuration', false) #2 /home/rmagaz72/public_html/config/alias.php(52): pSQL('configuration') #3 /home/rmagaz72/public_html/classes/Configuration.php(155): bqSQL('configuration') #4 /home/rmagaz72/public_html/classes/Configuration.php(209): ConfigurationCore::loadConfiguration() #5 /home/rmagaz72/public_html/classes/PrestaShopAutoload.php(171): ConfigurationCore::get('PS_DISABLE_OVER...') #6 /home/rmagaz72/public_html/classes/PrestaShopAutoload.php(130): PrestaShopAutoload->generateIndex() #7 [internal function]: PrestaShopAutoload->load('AddressFormat') #8 /home/rmagaz72/public_html/classes/Tools.php(3386): spl_autoload_call('AddressFormat') #9 /home/rmagaz72/public_html/classes/db/Db.php(794): ToolsCore::nl2br('magazin-non-sto...') #10 /ho in /home/rmagaz72/public_html/classes/Tools.php on line 3386

After deleting cache from server, when accessing administration URL we get this error code:

Whoops, looks like something went wrong.

(1/1) UndefinedMethodException

Attempted to call an undefined method named "isEnabled" of class "Module".

in Hook.php line 119

at Hook::getAllHookRegistrationsLG(object(Context), 'moduleRoutes')in Hook.php line 36

at Hook::getHookModuleExecList('moduleRoutes')in Hook.php line 798

at HookCore::exec('moduleRoutes', array('id_shop' => 1), null, true, false, false, null, false)in ets_hook line 230

at Ets_Hook::exec17('moduleRoutes', array('id_shop' => 1), null, true, false, false, null, false, array(array('file' => '/home/rmagaz72/public_html/classes/Dispatcher.php', 'line' => 596, 'function' => 'exec', 'class' => 'Hook', 'type' => '::')))in Hook.php line 16

at Hook::exec('moduleRoutes', array('id_shop' => 1), null, true, false)in Dispatcher.php line 596

at DispatcherCore->loadRoutes()in Dispatcher.php line 249

at DispatcherCore->__construct(object(Request))in Dispatcher.php line 207

at DispatcherCore::getInstance()in index.php line 93

The issue is not from caching, I deleted all cache from var folder, the problem still persists. The only way I can make the website live again is by recovering the files from yesterday or any day before, but the error is still there only it's not triggered yet.

What is your opinion on this error? I have never encountered it, and I do not seem to find a solution online for it.

My guess is it's something wrong with the server, because before the upgrade there was nothing wrong with the website. Same PHP version, no changes to the files, but he error appeared from nothing.

Thanks!

 

 

Screenshot 2022-05-26 141958.png

Screenshot 2022-05-26 141913.png

Screenshot 2022-05-26 141854.png

Screenshot 2022-05-26 143248.png

Link to comment
Share on other sites

Also, the error log is this:

Quote

[26-May-2022 14:46:10 Europe/Bucharest] PHP Fatal error:  Uncaught Error: Call to undefined method Module::isEnabled() in /home/rmagaz72/public_html/override/classes/Hook.php:119
Stack trace:
#0 /home/rmagaz72/public_html/override/classes/Hook.php(36): Hook::getAllHookRegistrationsLG(Object(Context), 'moduleRoutes')
#1 /home/rmagaz72/public_html/classes/Hook.php(798): Hook::getHookModuleExecList('moduleRoutes')
#2 /home/rmagaz72/public_html/modules/ets_pagecache/classes/ext/ets_hook(230): HookCore::exec('moduleRoutes', Array, NULL, true, false, false, NULL, false)
#3 /home/rmagaz72/public_html/override/classes/Hook.php(16): Ets_Hook::exec17('moduleRoutes', Array, NULL, true, false, false, NULL, false, Array)
#4 /home/rmagaz72/public_html/classes/Dispatcher.php(596): Hook::exec('moduleRoutes', Array, NULL, true, false)
#5 /home/rmagaz72/public_html/classes/Dispatcher.php(249): DispatcherCore->loadRoutes()
#6 /home/rmagaz72/public_html/classes/Dispatcher.php(207): DispatcherCore->__construct(Object(Symfony\Component\HttpFoundation\Request))
#7 /home/rmagaz72/public_ht in /home/rmagaz72/public_html/override/classes/Hook.php on line 119
[26-May-2022 14:46:16 Europe/Bucharest] PHP Fatal error:  Uncaught Symfony\Component\Filesystem\Exception\IOException: Unable to write to the "/home/rmagaz72/public_html/var/cache/prod/yaml" directory. in /home/rmagaz72/public_html/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:681
Stack trace:
#0 /home/rmagaz72/public_html/vendor/symfony/symfony/src/Symfony/Component/Config/ResourceCheckerConfigCache.php(124): Symfony\Component\Filesystem\Filesystem->dumpFile('/home/rmagaz72/...', '<?php return ar...')
#1 /home/rmagaz72/public_html/src/Core/Util/File/YamlParser.php(92): Symfony\Component\Config\ResourceCheckerConfigCache->write('<?php return ar...', Array)
#2 /home/rmagaz72/public_html/src/Core/Addon/Module/ModuleManagerBuilder.php(161): PrestaShop\PrestaShop\Core\Util\File\YamlParser->parse('/home/rmagaz72/...')
#3 /home/rmagaz72/public_html/src/Core/Addon/Module/ModuleManagerBuilder.php(87): PrestaShop\PrestaShop\Core\Addon\Module\ModuleManagerBuilder->__construct()
#4 /home/rmagaz72/public_html/controllers/front/ProductController.php(215) in /home/rmagaz72/public_html/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php on line 681

 

Link to comment
Share on other sites

You are running an outdated version from PrestaShop together with a non-compatible PHP version:

https://devdocs.prestashop.com/1.7/basics/installation/system-requirements/#php-compatibility-chart

My advice would be to update PS to the latest version.

And the error is thrown by an override from the cookies module. I think you can rename /override/classes/Hook.php meanwhile.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...