Jump to content

Fatal Error 500


Recommended Posts

I was trying to remove the contact us link from the top of the page by adjusting the hooks ..(which I don't fully understand) when everything crashed and I got the dreaded error 500. I could no longer access the dashboard fully to enable the debug mode but found help from Daniel Patilea by accessing config/defines.inc.php and changing false to true on line 29. I then get this.

Symfony\Component\Debug\Exception\FatalErrorException:
Error: Call to a member function isLogged() on null

  at modules/contactform/contactform.php:390

Now I get this message "An error occurred while loading the web debug toolbar. Open the web profiler." and when I click on this I get a frightening  "Whoops, looks like something went wrong" with pages of "Twig_error_runtime" I'm lost and cannot seem to fix things. I'd like to disable the shop but cannot get to the tab on the dashboard and don't know where to access the 'switch' in the cpanel.

In debug mode I accessed this info;

Log Messages

    Info. & Errors 2Deprecations 0Debug 2PHP Notices 0Container 765

Informational and error log messages generated during the execution of the application.
Level     Channel     Message
INFO 12:16:04     request     Matched route

"admin_system_information"

.
Show context
INFO 12:16:04     security     Populated the TokenStorage with an anonymous Token.
CRITICAL 12:16:07     php     Fatal Error: Call to a member function isLogged() on null
Hide context

[▼
  "exception" => FatalErrorException {#1 ▼
    #message: "Error: Call to a member function isLogged() on null"
    #code: 0
    #file: "/home/perfumer/public_html/modules/contactform/contactform.php"
    #line: 390
    #severity: E_ERROR
  }
]

CRITICAL 12:16:08     request     Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException: "Error: Call to a member function isLogged() on null" at /home/perfumer/public_html/modules/contactform/contactform.php line 390
Hide context

[▼
  "exception" => FatalErrorException {#1 ▼
    #message: "Error: Call to a member function isLogged() on null"
    #code: 0
    #file: "/home/perfumer/public_html/modules/contactform/contactform.php"
    #line: 390
    #severity: E_ERROR
  }
]

Any help would be greatly appreciated.

Liam

 

Edited by Liam
More info (see edit history)
Link to comment
Share on other sites

try to rename the /modules/contactform to something like /modules/contactform.bak and see if you can access your BO; if yes then further replace the files you modified with the ones from the original PS archive and rename the module back to contactform.

Link to comment
Share on other sites

Hi,

Many thanks for your helpful response. I actually did what you suggested and can now access the back office. I replaced the original contactform with a downloaded 'virgin' file but the error still persists. I then reset as many of the hooks as I remembered changing and a few other tips I picked up from the forum.

With the contactform commented out I can access the back office but certain functions won't then work , I can't for instance upload a new product. With the contactform unremmed (if that's the right word) the website appears to work OK but taking a test purchase right the way thru to the Paypal portal gives an error in ajax post moved permantly. I'm going to try replacing as many files as I remember changing today and will let you know the outcome. Thanks again.

Liam

 

Link to comment
Share on other sites

  • 2 weeks later...

Prestashop 1.7.4.2. Just to bring any viewer up to date with my problem;

No luck with any fixes so far. I could access the back office and the error 500 disappeared if I renamed the contactform module. In fact if I just renamed the contactform.php file it had the same effect. The front shop appears to be ok but certain sections did not work. So I first uploaded a clean contactform module from PS 1.7.4.2. It did not help. Then I did a manual upgrade to PS 1.7.4.4 ( the 1 click option just returns an error 500) I renamed the admin folder to the correct prestashop generated one, deleted the img and overrides folders from the uploaded version in an effort to keep my shop intact and copied the classes and mail folders from a backup. I renamed the vendor folder on the existing site as recommended and FTP'd the remaining directories and files to public_html. When I ran the upgrade.php I was given an xml =28. So I restored a db backup and ran the upgrade.php again and this time was given an xml =32. I understand the 32 means the upgrade was not required. Now my dashboard says the ps version is 1.7.4.4 but the problem remains with the contactform module or contactform.php needing to be renamed in order to access the back office.

Some facts;

The update products did not work until I changed the php version to inherit 5.6 ... I had it on 7.2
The paypal module did not work until I enabled SSL on all pages. I previously had just enabled some pages.
The shop seems to work ok now when the contactform is enabled on the server ... but then I cannot access the back office. I'm blocked with the server error 500

I cannot understand why I get the server error 500 when I have renewed all the PS directories and files ... unless the overrides directory is somehow involved. 

I have some more tests to do but If someone could explain this anomaly with the contactform module I'd be very grateful.

Thanks,
Liam

 

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