Jump to content

Declaration of AdminLoginControllerCore::viewAccess() must be compatible with AdminControllerCore:


Car Paradise
 Share

Recommended Posts

 
Hello, I'm really desperated for help. Trying to figure out this problem for a week..
I was using prestashop on hosting with no problem. Now I started my home web server and I'm trying to get it working.

I tried many different prestashop versions and reinstalled them x times.. All the time problem is that, I can Access front panel, but not the backend panel..

All the time it shows Http 500 ERROR : Server can't Handle this request. Now I enabled debugging and it shows me error:

Fatal error: Declaration of AdminLoginControllerCore::viewAccess() must be compatible with AdminControllerCore::viewAccess($disable = false) in C:\xampp\htdocs\Shop\controllers\admin\AdminLoginController.php on line 27

And Line 27

class AdminLoginControllerCore extends AdminController{

I can't understand why this is happening, because I haven't edited and changed any file or folder.

Share this post


Link to post
Share on other sites

have you installed a module, or created a custom override of the AdminLoginController?

For overrides, check the /override/controller/admin/ folder to see if you have an override file there.  If you do, then you must figure out why...

Share this post


Link to post
Share on other sites

12 hours ago, bellini13 said:

have you installed a module, or created a custom override of the AdminLoginController?

For overrides, check the /override/controller/admin/ folder to see if you have an override file there.  If you do, then you must figure out why...

Hello.

How I earlier said. I haven't changed anything just deleted instalation folder. No folder or file has been edited. And no modules are installed(Don't even know how to do it if I can't acces backend)

Share this post


Link to post
Share on other sites

Check which PHP Version is running on the webserver. I got this error when running on PHP 7.2.
I switched back to 7.1 (7.1.15 to be exact) and it solved the problem.
PHP 5.6, 7.0, 7.1 are definitely working.

  • Thanks 1

Share this post


Link to post
Share on other sites

41 minutes ago, eugenata said:

Modify: /controllers/admin/AdminLoginController.php

from:

public function viewAccess()
    {
        return true;
    }

to:

public function viewAccess($disable = false)
    {
        return true;
    }

work on 7.2 php version

 

Of course this works, but unfortunately that's not the only spot. You'll need to change every overriding method and not only for viewAccess, there are other Methods built the same way you need to change them also.
So it's way easier and less time consuming to just switch the php version

Share this post


Link to post
Share on other sites

  • 2 weeks later...

@kirvad - your problem is a on your openssl module (not well configured) and writing permissions on folder /themes. This folder, all sub-folder should have chmod 0750 or at least 0755 (not 0777!) and all files in there 0644

You should contact your provider with the errors you are having.

Share this post


Link to post
Share on other sites

@selectshop.at thanks, that would then explain the message:

Warning: openssl_decrypt(): IV passed is only 7 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /mnt/web107/d0/05/5176805/htdocs/Prestashop_05/classes/Rijndael.php on line 85

but i don't use ssl at the moment. any ideas?

Share this post


Link to post
Share on other sites

Yes in fact there are some problems related to your server. decrypt is not correct (using wrong openssl version) AND your server are having writing/reading permissions. Only the server admin can solve your problem. You should ask for support of server admin/provider.

  • Thanks 1

Share this post


Link to post
Share on other sites

  • 7 months later...
On 28/3/2018 at 9:23, SeKa said:

Compruebe qué versión de PHP se está ejecutando en el servidor web. Tengo este error cuando se ejecuta en PHP 7.2.
Cambié de nuevo a 7.1 (7.1.15 para ser exactos) y resolvió el problema.
PHP 5.6, 7.0, 7.1 definitivamente están funcionando.

gracias amigo solucionado, tenia la version 7.2 y la cambie a la 7.1 

Share this post


Link to post
Share on other sites

  • 3 months later...
On 3/28/2018 at 8:39 AM, Car Paradise said:

Hello.

How I earlier said. I haven't changed anything just deleted instalation folder. No folder or file has been edited. And no modules are installed(Don't even know how to do it if I can't acces backend)  FileZilla Malwarebytes Rufus 

I tried many different prestashop versions and reinstalled them x times.. All the time problem is that, I can Access front panel, but not the backend panel..

Edited by CORIYATSIA (see edit history)

Share this post


Link to post
Share on other sites

  • 1 month later...

I had same exact issue today.. I wanted to remove that red bar for support that displays in dashboard, so I uninstalled the facebook OpenGraph Tags module.. This gave me issues when trying to uninstall (gave me error message that I did not document), but finally was able to do so.. Then today, I tried to access BO and experienced 500 error, but the website was functioning..  I debugged and received following error.

Fatal error: Declaration of AdminLoginControllerCore::viewAccess() must be compatible with AdminControllerCore::viewAccess($disable = false) in /home/notredamefinejew/public_html/controllers/admin/AdminLoginController.php on line 27

After clearing out cache and following other forum posts suggestions (disable module gamification) with no success, I decided to look into the php version.

I was running php 7.0 and after upgrading to php 7.1, problem has since resolved!

I'm now able to access BO, and FO still functioning with no issues.

Share this post


Link to post
Share on other sites

  • 10 months later...
  • 1 year later...

hi,

had same issue with PS 1.6 and PHP 7.4
Solved changing to PHP 7.1

J'avais le même pb avec un PS 1.6 chez OVH et PHP 7.4
Résolu en redescendant PHP en 7.1
 

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More