Jump to content

[SOLVED]Fatal error on Products Category


Recommended Posts

My guess is that you have products with an invalid default category. To be sure, you can edit the displayError function in classes/Tools.php and temporarily uncomment the debug_backtrace() line to get a stack trace instead of a "Fatal error" message. That should help you find the problem.

Link to comment
Share on other sites

My guess is that you have products with an invalid default category. To be sure, you can edit the displayError function in classes/Tools.php and temporarily uncomment the debug_backtrace() line to get a stack trace instead of a "Fatal error" message. That should help you find the problem.


pls advise ho to do this : edit the displayError function in classes/Tools.php and temporarily uncomment the debug_backtrace() line to get a stack trace instead of a "Fatal error" message.

thanks
Link to comment
Share on other sites

Change line 403 of classes/Tools.php (in PrestaShop v1.3.2) from:

//if ($string == 'Fatal error') d(debug_backtrace());



to:

if ($string == 'Fatal error') d(debug_backtrace());



This will display a stack trace of what led to the error.

Link to comment
Share on other sites

The following code in the stack trace told me the error happened on line 205 of classes/Tax.php:

Array
(
   [0] => Array
       (
           [file] => /home/sahabat/public_html/classes/Tax.php
           [line] => 205
           [function] => displayError
           [class] => Tools
           [type] => ::
           [args] => Array
               (
               )

       )



Which led me to the if statement that decides whether to generate the error:

if (!Validate::isLoadedObject($defaultCountry))



After seeing that, I knew that the default country was failing to load, so it must be set to a country that doesn't exist.

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