contao/import — Issue #2236: BackendUser __destruct() throwing an error in this circumstance...
Author: importer
Created: 2011-11-29 19:15:23+00:00
State: open
Labels: Accepted, Feature, framework

Hi Leo,

I'm having a hard time pinpointing the problem that causes this error, but here is the error and I'll explain...

> Fatal error: BackendUser::__destruct() [backenduser.--destruct]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "DB_Mysql" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/bwinans/public_html/betatest/system/modules/backend/BackendUser.php on line 104

First, the solution has been to add $this->import('Database'); to BackendUser::__destruct() to allow it to make its update. On the other hand, we have some javascript (std. mootools) that runs on page load for two custom widgets, and these make AJAX calls in their loading process. The solution works fine, but I can't figure what if anything the AJAX requests on load might have to do with this. Other aspects of the DCA are completely normal, so there is nothing unusual there. If you would like to see what I mean, I would have to set you up with a login and explain further...

--- _Originally created by fbliss on July 2nd, 2010, at 07:43pm (ID 2236)_