Author - StudySection Post Views - 36 views

Exception – Class Not Found in Moodle/Totara

What is the “Class NOT FOUND” exception:

From the name of this exception, we can understand when your created class is not found on runtime, then it occurs. The server catches all exceptions. Each exception has its own error format and contains a “translated message + debuginfo”. Let us understand this concept by an example:

I have created a local plugin “test”. I wanted to add a class for logging “crud” operations on my plugin. But when I created a class “log_crud.php” under the “/classes/” folder, the following error was appearing on the screen:


After researching, I found that Totara/Moodle caches all autoloaded class names. Autoloading is the process of automatically loading classes without calling the include(), require_once() functions to load them. This is a cache issue, so to resolve this error, you can follow any method given in below:

  1. You can clear the cache by going through the “Site Administration => Development => Purge All caches” page.
  2. You can upgrade your plugin version for eg- the current version is “201901015”, increase it by one “201901016. Then go to “Site Administration => Notifications” and install the latest version of your plugin.

People having good knowledge of Financial accounting can get an Accounting Certification Exams from StudySection to increase their chances of getting a job in this field. You can get a foundation level certification if you are new to Financial accounting or you can go for advanced level certification if you have expert level skills in Financial accounting.

Leave a Reply

Your email address will not be published. Required fields are marked *