Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  • 0
rubben1985

error 500 when activating debug mode

Question

Hi,

I am having some issues with visual composer module so I activated debug mode trying to find the problem. When I activated it since the backoffice, this happened:

0_1545930950942_47edacb6-d569-4175-ae46-2957fcfd126b-image.png

this was the server log: 0_1545930981828_01826541-19bf-49db-9f5b-76aa49d5deff-image.png

The hosting technical service deactivated the debug mode because I could not access to the backoffice.

Any ideas why debug mode made this when I activated?

Thanks

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

The error message is complaining about missing method Validate::isJSON. That's very strange, because this method is clearly there.

There are only two explanations I can think of.

  1. you have modified core class classes/Validate.php and removed/renamed this method. That's very unlikely.
  2. The other possibility is classname conflict. It's possible that some module have class with name Validate, and this class gets loaded at the very beginning of the request. Thirtybees uses lazy loading autoloader, which means it will load any core class only when needed. In this case the core class would never be loaded, because class with the same name exists. But this third party Validate class does not contain isJSON method. This is another way to override core classes. Unlike normal overrides, which extends core class, this method replace the whole core class. Very dangerous, and officially not supported. But some module developers do this kind of things

Share this post


Link to post
Share on other sites
  • 0

Not sure but some time ago I modify the validate.php to use cleantalk services and avoid spam (some weeks almost 1000 spammers :O )

Maybe I did something wrong? Or I add it the code in a wrong way? (I attach them both, original and modified if you could check it :) )

Share this post


Link to post
Share on other sites
  • 0

anyone with programming knowledge can tell me if I did something wrong with the code I introduced in the validate file? (code was to make work a module). In the actual state when I activate debug, site breaks so I can not use it but I need the code inside the file (but maybe I made something wrong even if the module now it works)

Share this post


Link to post
Share on other sites
  • 0

@rubben1985 said in error 500 when activating debug mode:

anyone with programming knowledge can tell me if I did something wrong with the code I introduced in the validate file? (code was to make work a module). In the actual state when I activate debug, site breaks so I can not use it but I need the code inside the file (but maybe I made something wrong even if the module now it works)

No way anyone can tell you how that will work out. Both functions that you have added include an external file that you haven't added.

Share this post


Link to post
Share on other sites
  • 0

@rubben1985 these particular changes are fine. We don't know, of course, how does the external file look like.

I really think that some module or vendor library introduces class named Validate, and that this class gets loaded at the very beginning of the request. That would prevent loading Validate core class, and results in this kind of error. Search for class Validate

  • Like 1

Share this post


Link to post
Share on other sites
  • 0
On 1/5/2019 at 11:30 AM, datakick said:

@rubben1985 these particular changes are fine. We don't know, of course, how does the external file look like.

I really think that some module or vendor library introduces class named Validate, and that this class gets loaded at the very beginning of the request. That would prevent loading Validate core class, and results in this kind of error. Search for class Validate

With the forum migration I lost notifications and I did not saw the post...

Any advice on how to identify/find this?

Share this post


Link to post
Share on other sites
  • 0

The easiest way is to edit Module.php file, and just before the line where it failed add this code:

            die((new ReflectionClass('Validate'))->getFileName());

Then refresh your front page. Instead of your beautiful thirtybees shop you will see file path to the Validate class.

Don't forget to remove this line after 🙂

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

×