Jump to content

Compile Error: Declaration of Mobile_Theme::disable() must be compatible with ModuleCore::disable($force_all = false)


Recommended Posts

Hello,

I need your help please! 😞

In the debog mode I see the following error (while trying to open in BO the "Module management" or "Paiement Module" for instance):

Compile Error: Declaration of Mobile_Theme::disable() must be compatible with ModuleCore::disable($force_all = false)

The fatal error seems to be located in modules/mobile_theme/mobile_theme.php (line 400)
     * When disabling the module, we need to edit the settings to also disable the theme swtich.
     * When enabling it, the settings will be rewritten automatically with the performances system.
     *
     */
    public function disable()
    {
        Configuration::updateValue('PS_MOBILE_MODULE_ENABLED', 0);
        $this->editSettings(false);
        return parent::disable();
    }

=> What should I do now? How can I fix it?

In the normal mode I see the famous "500 Internal Server error"... 

I tried to contact the technical service of Prestashop Marketplace for a week but nobody replies.

Thank you in advance for any kind of advice.

Best,

Julienne

Fatal error - Debug.JPG

Link to comment
Share on other sites

Hi Julienne

Instead of below:

public function disable()
    {
        Configuration::updateValue('PS_MOBILE_MODULE_ENABLED', 0);
        $this->editSettings(false);
        return parent::disable();
    }

Try below:

public function disable($force_all = false)
    {
        Configuration::updateValue('PS_MOBILE_MODULE_ENABLED', 0);
        $this->editSettings(false);
        return parent::disable(false);
    }

As you see, I added the some parameters into the disable function brackets. Two locations modified.

Edited by MEG Venture (see edit history)
  • Thanks 1
Link to comment
Share on other sites

28 minutes ago, MEG Venture said:

Hi Julienne

Instead of below:

public function disable()
    {
        Configuration::updateValue('PS_MOBILE_MODULE_ENABLED', 0);
        $this->editSettings(false);
        return parent::disable();
    }

Try below:

public function disable($force_all = false)
    {
        Configuration::updateValue('PS_MOBILE_MODULE_ENABLED', 0);
        $this->editSettings(false);
        return parent::disable(false);
    }

As you see, I added the some parameters into the disable function brackets. Two locations modified.

Thank you sooooo much MEG! 🙂 You made my day. Just perfect. It works well now. Problem is fixed.
Best,
 

  • Like 1
Link to comment
Share on other sites

Hello again dear MEG Team,

New module installed in Prestashop and new bugs... ;) 

Attempted to load class "AddonsCredentialsEncryptionListener" from namespace "PrestaShop\Module\Mbo\Addons\Listener".
Did you forget a "use" statement for another namespace?

at /srv/data/web/vhosts/kekeli-creation.com/htdocs/var/cache/dev/ContainerG5HCYnH/appAppKernelDevDebugContainer.php:2949

at ContainerG5HCYnH\appAppKernelDevDebugContainer->getMbo_Addons_EventListener_AddonsCredentialsEncryptionListenerService() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/var/cache/dev/ContainerG5HCYnH/appAppKernelDevDebugContainer.php:2613)

at ContainerG5HCYnH\appAppKernelDevDebugContainer->ContainerG5HCYnH\{closure}() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:178)

at Symfony\Component\EventDispatcher\EventDispatcher->removeListener() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php:338)

at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->preProcess() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php:162)

at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:202) at Symfony\Component\HttpKernel\HttpKernel->filterResponse() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:190)

at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:81) at Symfony\Component\HttpKernel\HttpKernel->handle() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ErrorListener.php:60)

at Symfony\Component\HttpKernel\EventListener\ErrorListener->onKernelException() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php:126)

at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:264)

at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:239)

at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:73)

at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php:168)

at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:229) at Symfony\Component\HttpKernel\HttpKernel->handleThrowable() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:120)

at Symfony\Component\HttpKernel\HttpKernel->terminateWithException() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php:129)

at Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::Symfony\Component\HttpKernel\EventListener\{closure}() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/ErrorHandler/ErrorHandler.php:601) at Symfony\Component\ErrorHandler\ErrorHandler->handleException()

=> Can you please help with this issue? :) 

Thank in in advance.

Best,

Julienne

Link to comment
Share on other sites

Hi again

The error you're seeing suggests that PrestaShop is trying to load the AddonsCredentialsEncryptionListener class from the specified namespace but cannot find it. There could be several reasons for this error.

  • Check if the File Exists:

    Navigate to the directory path mentioned in the namespace, i.e., PrestaShop/Module/Mbo/Addons/Listener and verify that the file containing the class AddonsCredentialsEncryptionListener is present.

  • Verify the Namespace:

    Open the file (if it exists) and ensure the namespace at the top of the file matches "PrestaShop\Module\Mbo\Addons\Listener".

  • Reinstall the Module:

    If the issue persists, and it's related to a specific module (in this case, it appears to be the MBO module), you might consider reinstalling that module. Before doing this, ensure that you backup any customizations or configurations related to that module.

 

Link to comment
Share on other sites

Il y a 1 heure, MEG Venture a dit :

Hi again

The error you're seeing suggests that PrestaShop is trying to load the AddonsCredentialsEncryptionListener class from the specified namespace but cannot find it. There could be several reasons for this error.

  • Check if the File Exists:

    Navigate to the directory path mentioned in the namespace, i.e., PrestaShop/Module/Mbo/Addons/Listener and verify that the file containing the class AddonsCredentialsEncryptionListener is present.

  • Verify the Namespace:

    Open the file (if it exists) and ensure the namespace at the top of the file matches "PrestaShop\Module\Mbo\Addons\Listener".

  • Reinstall the Module:

    If the issue persists, and it's related to a specific module (in this case, it appears to be the MBO module), you might consider reinstalling that module. Before doing this, ensure that you backup any customizations or configurations related to that module.

 

Thank you for your detailed answer. Much appreciated!

I didn't find the file in PrestaShop/Module/Mbo/Addons/Listener because I already disabled all non-integrated modules in Performance (they were many of them). I just enabled PayPal again. Then I cleared the cache and reloaded the BO.
=> Should I disable also all class and controller overloads?

My current problem now is the following: While setting off the Debug mode I just see the "500 Internal Server Error" in the BO.
When I set on the debug mode again from FTP access I can use my BO again and then I don't see any error on the front office...
- Prestashop version: 8.0.3
- PHP version: 8.1.16


Thank you in advance for any advice.

Debug.JPG

ClassNotFoundError.JPG

Link to comment
Share on other sites

OK thank you.
Now it's a bit more tricky for me: I just wanted to delete the ps_favicon and reinstall in the BO > Marketplace.

ErrorException: Warning: require(/srv/data/web/vhosts/kekeli-creation.com/htdocs/var/cache/dev/ContainerUoiewKi/getContainer_EnvVarProcessorsLocatorService.php): Failed to open stream: No such file or directory at /srv/data/web/vhosts/kekeli-creation.com/htdocs/var/cache/dev/ContainerUoiewKi/appAppKernelDevDebugContainer.php:2256 at require() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/var/cache/dev/ContainerUoiewKi/appAppKernelDevDebugContainer.php:2256) at ContainerUoiewKi\appAppKernelDevDebugContainer->load() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:255) at Symfony\Component\DependencyInjection\Container->make() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:231) at Symfony\Component\DependencyInjection\Container->get() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:409) at Symfony\Component\DependencyInjection\Container->getEnv() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/var/cache/dev/ContainerUoiewKi/appAppKernelDevDebugContainer.php:4236) at ContainerUoiewKi\appAppKernelDevDebugContainer->getMonolog_Handler_MainService() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/var/cache/dev/ContainerUoiewKi/appAppKernelDevDebugContainer.php:4271) at ContainerUoiewKi\appAppKernelDevDebugContainer->getMonolog_Logger_RequestService() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/var/cache/dev/ContainerUoiewKi/appAppKernelDevDebugContainer.php:2770) at ContainerUoiewKi\appAppKernelDevDebugContainer->getHttpKernelService() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:257) at Symfony\Component\DependencyInjection\Container->make() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:231) at Symfony\Component\DependencyInjection\Container->get() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:214) at Symfony\Component\HttpKernel\Kernel->getHttpKernel() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:201) at Symfony\Component\HttpKernel\Kernel->handle() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/admin396aqggygh5r8lti3of/index.php:81)

How can I get back to the BO? Debug file in the FTP does not work anymore...

Best,

Error-Favicon.JPG

Favicon.JPG

Favicon.pdf

Kernel Index.JPG

Edited by juliennebreitenstein (see edit history)
Link to comment
Share on other sites

Il y a 12 heures, MEG Venture a dit :

Whether you disable or not, the file should be there. I would recommend to uninstall and delete the mbo module and download again from Prestashop to reinstall. 

Thank you. I tried to uninstall and detele the mbo module, then I downloaded again from PS. The errors are still there (new ones). ;-(
Can you check my comment under this thread please and help me with the error lines:

 

Error-Favicon.JPG

Kernel Index.JPG

Link to comment
Share on other sites

Hello, how are you? I've seen your errors, and they are complex. Undoubtedly, the original programmer should help you fix them. Keep in mind that if you still have the ZEN option of the module, they are obligated to respond to you within 24 hours. Best regards, and I apologize for not being able to help you further. If it were something simpler, I would correct it without any issues, but it's not the case. Have a great day!

Link to comment
Share on other sites

il y a 8 minutes, Yelish a dit :

Hello, how are you? I've seen your errors, and they are complex. Undoubtedly, the original programmer should help you fix them. Keep in mind that if you still have the ZEN option of the module, they are obligated to respond to you within 24 hours. Best regards, and I apologize for not being able to help you further. If it were something simpler, I would correct it without any issues, but it's not the case. Have a great day!

Hello and thank you for your quick answer. Sorry to hear that the errors are complex. ;-(
The modules are all for free. Does the ZEN option of theses modules exist in this case? I don't buy any modules from PS.
Have a great day too!

Link to comment
Share on other sites

il y a 2 minutes, Yelish a dit :

Have you tried clearing the cache first? It's a basic question, not only through the back office but also physically. It's in the "var/cache" directory (all the folders inside it).

Good point. Thank you. Should I simply delete all the files in the var/cache directory? (it means : the content of the 4 orders called "dev", "de~", "prod" and "pro_")?

Cache.JPG

Link to comment
Share on other sites

il y a 9 minutes, Yelish a dit :

Delete all the folders (including the actual folders) without any issues. Simpler yet, the cache folder should be empty.

Youpee! I can work with the BO again 🙂 Thank you very much for helping with the cache issue. It was full indeed.
My next step towards is to work in the BO without debug mode and all the errors I sent you as private message which still appear. ;) 

Link to comment
Share on other sites

12 hours ago, juliennebreitenstein said:

OK thank you.
Now it's a bit more tricky for me: I just wanted to delete the ps_favicon and reinstall in the BO > Marketplace.

ErrorException: Warning: require(/srv/data/web/vhosts/kekeli-creation.com/htdocs/var/cache/dev/ContainerUoiewKi/getContainer_EnvVarProcessorsLocatorService.php): Failed to open stream: No such file or directory at /srv/data/web/vhosts/kekeli-creation.com/htdocs/var/cache/dev/ContainerUoiewKi/appAppKernelDevDebugContainer.php:2256 at require() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/var/cache/dev/ContainerUoiewKi/appAppKernelDevDebugContainer.php:2256) at ContainerUoiewKi\appAppKernelDevDebugContainer->load() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:255) at Symfony\Component\DependencyInjection\Container->make() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:231) at Symfony\Component\DependencyInjection\Container->get() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:409) at Symfony\Component\DependencyInjection\Container->getEnv() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/var/cache/dev/ContainerUoiewKi/appAppKernelDevDebugContainer.php:4236) at ContainerUoiewKi\appAppKernelDevDebugContainer->getMonolog_Handler_MainService() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/var/cache/dev/ContainerUoiewKi/appAppKernelDevDebugContainer.php:4271) at ContainerUoiewKi\appAppKernelDevDebugContainer->getMonolog_Logger_RequestService() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/var/cache/dev/ContainerUoiewKi/appAppKernelDevDebugContainer.php:2770) at ContainerUoiewKi\appAppKernelDevDebugContainer->getHttpKernelService() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:257) at Symfony\Component\DependencyInjection\Container->make() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:231) at Symfony\Component\DependencyInjection\Container->get() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:214) at Symfony\Component\HttpKernel\Kernel->getHttpKernel() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:201) at Symfony\Component\HttpKernel\Kernel->handle() (/srv/data/web/vhosts/kekeli-creation.com/htdocs/admin396aqggygh5r8lti3of/index.php:81)

How can I get back to the BO? Debug file in the FTP does not work anymore...

Best,

Error-Favicon.JPG

Favicon.JPG

Favicon.pdf 449.09 kB · 2 downloads

Kernel Index.JPG

Seems a cache error. Can you please try to delete the cache folder manually?

delete or rename the var/cache/prod and var/cache/dev folders.

 

  • Thanks 1
Link to comment
Share on other sites

il y a une heure, MEG Venture a dit :

Seems a cache error. Can you please try to delete the cache folder manually?

delete or rename the var/cache/prod and var/cache/dev folders.

 

Indeed it was a cache error. I just deleted the cache folder manually and I switched off the debug mode without any failure. Youpee ! Thank you so much again. 

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...